From b03c66b75e77c429a2ee40c66cb2ed00bffe1dfc Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 29 Feb 2016 15:09:40 +0100 Subject: [PATCH] Adding state for creating /etc/postfix/postfix.pem --- postfix/common.sls | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/postfix/common.sls b/postfix/common.sls index 6fc8a39..585a191 100644 --- a/postfix/common.sls +++ b/postfix/common.sls @@ -33,28 +33,40 @@ postfix: - 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 -- 2.39.5