summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2019-05-13 11:29:47 +0200
committerCorentin LABBE <clabbe@baylibre.com>2019-05-13 11:29:47 +0200
commit6f153a0ac4d9361aa0f8ecf7d2ba30e16bddc274 (patch)
tree623814a65b61818122f64ebd3a860fef05669714
parent4ae24270f6e8e853ca97cdd1f926da486a39a387 (diff)
lava-slave: generate lavacli default identities
-rw-r--r--lava-slave/Dockerfile3
-rwxr-xr-xlava-slave/scripts/setup.sh2
-rwxr-xr-xlavalab-gen.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile
index f5ce287..d6375f2 100644
--- a/lava-slave/Dockerfile
+++ b/lava-slave/Dockerfile
@@ -57,6 +57,9 @@ RUN mkdir /etc/lava-coordinator/
COPY lava-coordinator/* /etc/lava-coordinator/
RUN if [ -e /etc/lava-coordinator/lava-coordinator.cnf ]; then DEBIAN_FRONTEND=noninteractive apt-get -y install lava-coordinator && mv /etc/lava-coordinator/lava-coordinator.cnf /etc/lava-coordinator/lava-coordinator.conf ; fi
+# needed for lavacli identities
+RUN mkdir -p /root/.config
+
COPY devices/ /root/devices/
COPY tags/ /root/tags/
COPY deviceinfo/ /root/deviceinfo/
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index 0b8a0b2..fce01f8 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -10,6 +10,8 @@ if [ -z "$LAVA_MASTER_URI" ];then
exit 11
fi
+lavacli identities add --uri $LAVA_MASTER_BASEURI --token $LAVA_MASTER_TOKEN --username $LAVA_MASTER_USER default
+
echo "Dynamic slave for $LAVA_MASTER ($LAVA_MASTER_URI)"
LAVACLIOPTS="--uri $LAVA_MASTER_URI"
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 86d750f..e51b891 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -413,6 +413,9 @@ def main():
remote_proto = worker["remote_proto"]
remote_uri = "%s://%s:%s@%s:%s/RPC2" % (remote_proto, remote_user, remote_token, remote_address, remote_rpc_port)
dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_URI"] = remote_uri
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_USER"] = remote_user
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_BASEURI"] = "%s://%s:%s/RPC2" % (remote_proto, remote_address, remote_rpc_port)
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_TOKEN"] = remote_token
if "lava-coordinator" in worker and worker["lava-coordinator"]:
fcoordinator = open("%s/lava-coordinator/lava-coordinator.cnf" % workerdir, 'w')