diff --git a/postfix/tasks/main.yml b/postfix/tasks/main.yml index 6272be33..a1b5a424 100644 --- a/postfix/tasks/main.yml +++ b/postfix/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: check if main.cf is default - shell: 'grep -v -E "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum -' + shell: 'grep -v -E "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum -' changed_when: False check_mode: no register: default_main_cf diff --git a/postfix/tasks/minimal.yml b/postfix/tasks/minimal.yml index 99b99003..d1e4b4c5 100644 --- a/postfix/tasks/minimal.yml +++ b/postfix/tasks/minimal.yml @@ -18,7 +18,7 @@ force: yes notify: restart postfix when: postfix_force_main_cf == True or - default_main_cf.stdout == "5450c05d65878e99dad696c7c722e511 -" or - default_main_cf.stdout == "30022953f1f61f002bfb72e163ecb27e -" + postfix_maincf_md5_jessie in default_main_cf.stdout or + postfix_maincf_md5_stretch in default_main_cf.stdout tags: - postfix diff --git a/postfix/tasks/packmail.yml b/postfix/tasks/packmail.yml index 3ffd096f..de9ee7ad 100644 --- a/postfix/tasks/packmail.yml +++ b/postfix/tasks/packmail.yml @@ -21,8 +21,8 @@ force: yes notify: restart postfix when: postfix_force_main_cf == True or - default_main_cf.stdout == "5450c05d65878e99dad696c7c722e511 -" or - default_main_cf.stdout == "30022953f1f61f002bfb72e163ecb27e -" + postfix_maincf_md5_jessie in default_main_cf.stdout or + postfix_maincf_md5_stretch in default_main_cf.stdout tags: - postfix diff --git a/postfix/vars/main.yml b/postfix/vars/main.yml new file mode 100644 index 00000000..e8a773c9 --- /dev/null +++ b/postfix/vars/main.yml @@ -0,0 +1,5 @@ +--- +## MD5 hash of default main.cf filter, obtained with this command : +# grep -v -E "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum - +postfix_maincf_md5_jessie: "5450c05d65878e99dad696c7c722e511" +postfix_maincf_md5_stretch: "30022953f1f61f002bfb72e163ecb27e"