summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rwxr-xr-xlavalab-gen.py12
2 files changed, 16 insertions, 1 deletions
diff --git a/README.md b/README.md
index 35cbd49..8a236f5 100644
--- a/README.md
+++ b/README.md
@@ -237,6 +237,11 @@ masters:
- username: The LAVA user owning the token below. (This user should be created via users:)
token: The token for this callback
description: The description of this token. This string could be used with LAVA-CI.
+ slaveenv: A list of environment to pass to slave
+ - name: slavename The name of slave (mandatory)
+ env:
+ - line1 A list of line to set as environment
+ - line2
slaves:
- name: lab-slave-XX The name of the slave (where XX is a number)
host: name name of the host running lava-slave-XX (default to "local")
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 202ec99..5191f07 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -93,7 +93,7 @@ def main():
else:
masters = workers["masters"]
for master in masters:
- keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys" ]
+ keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys", "slaveenv" ]
for keyword in master:
if not keyword in keywords_master:
print("WARNING: unknown keyword %s" % keyword)
@@ -243,6 +243,16 @@ def main():
ftok.write("TOKEN=" + vtoken + "\n")
ftok.write("DESCRIPTION=\"%s\"" % description)
ftok.close()
+ if "slaveenv" in worker:
+ for slaveenv in worker["slaveenv"]:
+ slavename = slaveenv["name"]
+ envdir = "%s/env/%s" % (workerdir, slavename)
+ os.mkdir(envdir)
+ fenv = open("%s/env.yaml" % envdir, 'w')
+ fenv.write("overrides:")
+ for line in slaveenv["env"]:
+ fenv.write(" %s\n" % line)
+ fenv.close()
default_slave = "lab-slave-0"
if "slaves" not in workers: