xmpp_cert_sync: keep Jinja out of the script's f-strings
All checks were successful
deploy / ansible (push) Successful in 7m24s

The metric line's {{cert=...}} braces were read as a Jinja expression
and failed the template. Render only the settings, the rest verbatim.

Assisted-by: Claude:opus-5-5
This commit is contained in:
Sergei Poljanski 2026-11-13 08:28:27 +04:00
commit 81191c951f
Signed by: asxpi
GPG key ID: 4F8851660FA4121B

View file

@ -12,6 +12,7 @@ KEY = "/root/.ssh/xmpp_cert_sync"
KNOWN = "/root/.ssh/xmpp_cert_sync_known_hosts" KNOWN = "/root/.ssh/xmpp_cert_sync_known_hosts"
STATE = "/var/lib/xmpp-cert-sync" STATE = "/var/lib/xmpp-cert-sync"
PROM = "{{ monitoring_textfile_dir }}/xmpp_cert.prom" PROM = "{{ monitoring_textfile_dir }}/xmpp_cert.prom"
{% raw %}
def not_after(pem): def not_after(pem):
@ -66,3 +67,4 @@ else:
with open(PROM + ".tmp", "w") as f: with open(PROM + ".tmp", "w") as f:
f.write("\n".join(lines) + "\n") f.write("\n".join(lines) + "\n")
os.replace(PROM + ".tmp", PROM) os.replace(PROM + ".tmp", PROM)
{% endraw %}