Format relay credentials file with jinja

master
Daniel Huber 5 years ago
parent 515e95076a
commit ae290482c0
No known key found for this signature in database
GPG Key ID: C115E532CE490E5A

@ -0,0 +1 @@
{{ RELAYHOST }} {{ RELAYUSER }}:{{ RELAYPASSWORD }}

@ -50,9 +50,7 @@ for map_file in glob.glob("/overrides/*.map"):
if "RELAYUSER" in os.environ: if "RELAYUSER" in os.environ:
path = "/etc/postfix/sasl_passwd" path = "/etc/postfix/sasl_passwd"
fileContent = "{} {}:{}".format(os.environ["RELAYHOST"], os.environ["RELAYUSER"], os.environ["RELAYPASSWORD"]) convert("/conf/sasl_passwd", path)
with open(path, "w") as f:
f.write(fileContent)
os.system("postmap {}".format(path)) os.system("postmap {}".format(path))
convert("/conf/rsyslog.conf", "/etc/rsyslog.conf") convert("/conf/rsyslog.conf", "/etc/rsyslog.conf")

Loading…
Cancel
Save