b1516091e78746690cbe7e4f92fcc4f61a17cb59
[ansible.git] / roles / postfix / tasks / postfix.yml
1 - name: install postfix
2   apt: name=postfix,bsd-mailx state=latest
3 - name: install postfix-mysql
4   when: postfix.vmail_mysql_password is defined
5   apt: name=postfix-mysql state=latest
6 - name: enable postfix
7   service: name=postfix enabled=yes
8 # config
9 - name: install postfix config
10   template:
11     dest: /etc/postfix/{{ item }}
12     src: templates/{{ item }}
13   loop:
14   - main.cf
15   - master.cf
16   notify: postfix
17 - name: install postfix mysql config
18   when: postfix.vmail_mysql_password is defined
19   template:
20     dest: /etc/postfix/{{ item }}
21     src: templates/{{ item }}
22     mode: u=rw,g=r,o=
23     group: postfix
24   loop:
25   - mysql_vmail_aliases.cf
26   - mysql_vmail_senders.cf
27   - mysql_vmail_users.cf
28   notify: postfix
29 - name: create empty maps
30   when: postfix.virtual_mailbox_domains is defined
31   copy:
32     dest: /etc/postfix/{{ item }}
33     content: ""
34     force: no
35   loop:
36   - virtual_alias_map
37   - transport_map
38 # cronjob
39 - name: delete old local-mail cronjob
40   file: path=/etc/cron.daily/local-mail state=absent
41 - name: install check-for-local-mail cronjob
42   copy:
43     dest: /etc/cron.daily/check-for-local-mail
44     src: files/check-for-local-mail
45     mode: u=rwx,g=rx,o=rx