From 3f63069424873eff0afeaa6c858cf4a2e93dc416 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 19 Jul 2020 14:45:46 +0200 Subject: [PATCH] updated postfix state --- states/postfix/config.sls | 8 ++++---- states/postfix/templates/pgsql.cf.j2 | 5 +++++ states/postfix/templates/plain.cf.j2 | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 states/postfix/templates/pgsql.cf.j2 delete mode 100644 states/postfix/templates/plain.cf.j2 diff --git a/states/postfix/config.sls b/states/postfix/config.sls index 2bf2c17..44bff67 100644 --- a/states/postfix/config.sls +++ b/states/postfix/config.sls @@ -28,18 +28,18 @@ postfix-master-cf: - watch_in: - service: postfix-service -{%- for key, value in postfix.config.pgsql.items() %} +{%- for key, value in postfix.config.pgsql.files.items() %} postfix-pgsql-{{ key }}: file.managed: - name: {{ postfix.base_dir }}/pgsql/{{ key }}.cf - - source: salt://postfix/templates/plain.cf.j2 + - source: salt://postfix/templates/pgsql.cf.j2 - user: root - group: root - mode: 644 - template: jinja - context: - value: | - {{ value|indent(8) }} + config: {{ postfix.config.pgsql.config }} + query: {{ value.query }} - watch_in: - service: postfix-service {% endfor %} diff --git a/states/postfix/templates/pgsql.cf.j2 b/states/postfix/templates/pgsql.cf.j2 new file mode 100644 index 0000000..ae4c30a --- /dev/null +++ b/states/postfix/templates/pgsql.cf.j2 @@ -0,0 +1,5 @@ +## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }} +{% for k, v in config.items() -%} +{{ k }} = {{ v }} +{% endfor -%} +query = {{ query }} diff --git a/states/postfix/templates/plain.cf.j2 b/states/postfix/templates/plain.cf.j2 deleted file mode 100644 index 40cf72a..0000000 --- a/states/postfix/templates/plain.cf.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ value }}