- file: /etc/postfix
- backup: minion
-/etc/postfix/main.cf:
+/etc/postfix/postfix-cert.cnf:
file.managed:
- - source: salt://postfix/files/main.cf
+ - source: salt://postfix/files/postfix-cert.cnf
- user: root
- group: root
- mode: 644
- require:
- - pkg: postfix
- file: /etc/postfix
- - watch_in:
- - service: postfix
- template: jinja
- backup: minion
-/etc/postfix/postfix-cert.cnf:
+postfix.pem:
+ cmd.run:
+ - name: /etc/postfix/mkpostfixcert
+ - unless:
+ - test -f /etc/postfix/postfix.pem
+ - test -s /etc/postfix/postfix.pem
+ - require:
+ - file: /etc/postfix
+ - file: /etc/postfix/mkpostfixcert
+ - file: /etc/postfix/postfix-cert.cnf
+
+/etc/postfix/main.cf:
file.managed:
- - source: salt://postfix/files/postfix-cert.cnf
+ - source: salt://postfix/files/main.cf
- user: root
- group: root
- mode: 644
- require:
+ - pkg: postfix
- file: /etc/postfix
+ - cmd: postfix.pem
+ - watch_in:
+ - service: postfix
- template: jinja
- backup: minion