2017-01-02 00:06:18 +01:00
|
|
|
- name: ensure packages are installed
|
|
|
|
apt:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- postfix
|
|
|
|
- mailgraph
|
|
|
|
|
|
|
|
- name: check if main.cf is default
|
|
|
|
shell: egrep -v "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum -
|
|
|
|
changed_when: False
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2017-01-02 00:06:18 +01:00
|
|
|
register: default_main_cf
|
2017-01-12 17:22:16 +01:00
|
|
|
|
2017-01-02 00:06:18 +01:00
|
|
|
- name: create minimal main.cf
|
|
|
|
template:
|
|
|
|
src: evolinux_main.cf.j2
|
|
|
|
dest: /etc/postfix/main.cf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2017-03-23 16:59:43 +01:00
|
|
|
mode: "0644"
|
2017-01-02 00:06:18 +01:00
|
|
|
force: yes
|
|
|
|
when: default_main_cf.stdout == "5450c05d65878e99dad696c7c722e511 -"
|
|
|
|
notify: restart postfix
|
|
|
|
|
|
|
|
- meta: flush_handlers
|
|
|
|
|
2017-01-02 00:32:29 +01:00
|
|
|
- include: slow_transport.yml
|
2017-01-12 17:22:16 +01:00
|
|
|
when: postfix_slow_transport_include
|