ansible-roles/postfix/tasks/main.yml

31 lines
769 B
YAML
Raw Normal View History

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
2017-10-08 22:47:03 +02:00
shell: grep -v -E "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum -
2017-01-02 00:06:18 +01:00
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-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
mode: "0644"
2017-01-02 00:06:18 +01:00
force: yes
2017-08-23 03:13:04 +02:00
when: default_main_cf.stdout == "5450c05d65878e99dad696c7c722e511 -" or
default_main_cf.stdout == "30022953f1f61f002bfb72e163ecb27e -"
2017-01-02 00:06:18 +01:00
notify: restart postfix
- meta: flush_handlers
- include: slow_transport.yml
when: postfix_slow_transport_include