- 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
- 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