summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2020-07-13 13:25:52 +0200
committerCorentin LABBE <clabbe@baylibre.com>2020-07-13 13:36:10 +0200
commit3fa641e74700acad323fe19f1eadb285aeb1dd66 (patch)
treecc13844c12d10cc63883f51d3d37390abe6960cb /lavalab-gen.py
parent3860f1bb528503f6f2fb38d79d207d13498bc226 (diff)
Permit to set the postgres lavaserver password
By setting pg_lava_password, the final lavaserver password will be set to this value.
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 521deda..fbe2df9 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -121,7 +121,7 @@ def main():
"healthcheck_url", "host", "http_fqdn",
"loglevel", "lava-coordinator",
"name",
- "persistent_db",
+ "persistent_db", "pg_lava_password",
"slave_keys", "slaveenv", "smtp",
"tokens", "type",
"users",
@@ -172,6 +172,13 @@ def main():
groupdir = "%s/groups" % workerdir
os.mkdir(groupdir)
worker = master
+ if "pg_lava_password" in master:
+ f_pg = open("%s/pg_lava_password" % workerdir, 'w')
+ f_pg.write(master["pg_lava_password"])
+ f_pg.close()
+ else:
+ f_pg = open("%s/pg_lava_password" % workerdir, 'w')
+ f_pg.close()
if "version" in worker:
dockerfile = open("%s/Dockerfile" % workerdir, "r+")
dockerfilec = re.sub('(^FROM.*:).*', '\g<1>%s' % worker["version"], dockerfile.read())