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 = { "*",