ansible/roles/mail/tasks/main.yml

40 lines
779 B
YAML

---
- name: Install packages
apt: name={{ item }} state=present
with_items:
- postfix
- amavisd-new
- postgrey
- spamassassin
- dovecot-core
- dovecot-imapd
- dovecot-sieve
- dovecot-managesieved
- dovecot-ldap
tags: mail
- name: Configure postfix
template: src={{ item }} dest=/etc/postfix/{{ item }}
with_items:
- ldap-aliases.cf.j2
- ldap-virtual-maps.cf.j2
notify: restart postfix
tags: mail
- name: Start amavis
service: name=amavis state=started enabled=yes
tags: mail
- name: Start dovecot
service: name=dovecot state=started enabled=yes
tags: mail
- name: Start postfix
service: name=postfix state=started enabled=yes
tags: mail
- name: Start postgrey
service: name=postgrey state=started enabled=yes
tags: mail