From 54c299c21e2dc1f869f80467766adf7263676ef2 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Sun, 22 Dec 2024 13:38:28 +0000 Subject: [PATCH] feat: dont pre-template nsca server conf pw --- pyansible.py | 2 +- templates/nsca_server.conf.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyansible.py b/pyansible.py index a15d336..ca11dab 100644 --- a/pyansible.py +++ b/pyansible.py @@ -16,7 +16,7 @@ def dump_config(vmList): f.write("\n") # dump ansible - with open("./ansible/files/nsca_server.conf", "w") as f: + with open("./ansible/templates/nsca_server.conf", "w") as f: env = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates")) template = env.get_template("nsca_server.conf.j2") f.write(template.render(vmList=sorted(list(set(filter(lambda x: x.ansible, vmList)))), diff --git a/templates/nsca_server.conf.j2 b/templates/nsca_server.conf.j2 index e634ac1..24db009 100644 --- a/templates/nsca_server.conf.j2 +++ b/templates/nsca_server.conf.j2 @@ -4,7 +4,7 @@ log_level = 2 {% for vmo in vmList %} authorize "{{ vmo.hostname }}" { - password = "{{ password }}" + password = "{% raw %}{{ nsca_server_password }}{% endraw %}" hosts = "{{ vmo.hostname }}" services = { "*",