From: Frank Brehm Date: Mon, 29 Feb 2016 14:25:09 +0000 (+0100) Subject: Adding states for postfix aliases X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=03e738ac6e20f187902500e0cf7c32805e23684c;p=salt%2Fstates.git Adding states for postfix aliases --- diff --git a/postfix/common.sls b/postfix/common.sls index 585a191..eed0798 100644 --- a/postfix/common.sls +++ b/postfix/common.sls @@ -55,6 +55,27 @@ postfix.pem: - file: /etc/postfix/mkpostfixcert - file: /etc/postfix/postfix-cert.cnf +# manage /etc/aliases if data found in pillar +{% if 'aliases' in pillar.get('postfix', '') %} +{{ postfix.aliases_file }}: + file.managed: + - source: salt://postfix/files/aliases + - user: root + - group: root + - mode: 644 + - template: jinja + - backup: minion + - require: + - pkg: postfix + +run-newaliases: + cmd.wait: + - name: newaliases + - cwd: / + - watch: + - file: {{ postfix.aliases_file }} +{% endif %} + /etc/postfix/main.cf: file.managed: - source: salt://postfix/files/main.cf @@ -65,6 +86,9 @@ postfix.pem: - pkg: postfix - file: /etc/postfix - cmd: postfix.pem +{% if 'aliases' in pillar.get('postfix', '') %} + - file: {{ postfix.aliases_file }} +{% endif %} - watch_in: - service: postfix - template: jinja