Postfix: extract main.cf md5sum into variables

haproxy_munin
Jérémy Lecour 5 years ago committed by Jérémy Lecour
parent 8a479eee3f
commit d355532a24
  1. 2
      postfix/tasks/main.yml
  2. 4
      postfix/tasks/minimal.yml
  3. 4
      postfix/tasks/packmail.yml
  4. 5
      postfix/vars/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

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

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

@ -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"
Loading…
Cancel
Save