2016-01-25 19:21:36 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install packages
|
|
|
|
apt: name={{ item }} state=present
|
|
|
|
with_items:
|
2016-02-01 20:52:34 +01:00
|
|
|
- amavisd-new
|
2016-02-15 21:04:01 +01:00
|
|
|
- bsd-mailx
|
2016-01-25 19:21:36 +01:00
|
|
|
- dovecot-core
|
2016-02-01 20:52:34 +01:00
|
|
|
- dovecot-imapd
|
2016-01-25 19:21:36 +01:00
|
|
|
- dovecot-ldap
|
2016-02-15 21:04:01 +01:00
|
|
|
- dovecot-managesieved
|
|
|
|
- dovecot-sieve
|
|
|
|
- postfix
|
|
|
|
- postfix-policyd-spf-python
|
|
|
|
- postgrey
|
|
|
|
- pyzor
|
|
|
|
- razor
|
|
|
|
- spamassassin
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Create vmail group
|
|
|
|
group: name=vmail gid=500 state=present
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Create vmail user
|
|
|
|
user: name=vmail uid=500 createhome=yes home=/var/vmail shell=/bin/false state=present
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Configure amavis
|
|
|
|
template: src={{ item }}.j2 dest=/etc/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- amavis/15-content_filter_mode
|
|
|
|
- amavis/50-user
|
|
|
|
notify: Restart amavis
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Configure dovecot
|
|
|
|
template: src={{ item }}.j2 dest=/etc/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- dovecot/dovecot-ldap.conf.ext
|
|
|
|
- dovecot/local.conf
|
|
|
|
notify: Restart dovecot
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Configure policyd
|
|
|
|
copy: src={{ item }} dest=/etc/postfix-policyd-spf-python/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- policyd-spf.conf
|
2016-02-01 20:52:34 +01:00
|
|
|
tags: mail
|
2016-01-25 19:21:36 +01:00
|
|
|
|
|
|
|
- name: Configure postfix
|
2016-02-15 21:04:01 +01:00
|
|
|
template: src={{ item }}.j2 dest=/etc/{{ item }}
|
2016-02-01 20:52:34 +01:00
|
|
|
with_items:
|
2016-02-15 21:04:01 +01:00
|
|
|
- postfix/helo_access
|
|
|
|
- postfix/ldap-aliases.cf
|
|
|
|
- postfix/ldap-virtual-maps.cf
|
|
|
|
- postfix/main.cf
|
|
|
|
- postfix/master.cf
|
|
|
|
- postfix/recipient_access
|
2016-02-15 19:17:28 +01:00
|
|
|
notify: Restart postfix
|
2016-02-01 20:52:34 +01:00
|
|
|
tags: mail
|
2016-01-25 19:21:36 +01:00
|
|
|
|
2016-02-15 21:04:01 +01:00
|
|
|
- name: Create razor directory structure
|
|
|
|
command: razor-admin -create chdir=/var/lib/amavis creates=/var/lib/amavis/.razor
|
|
|
|
become: yes
|
|
|
|
become_user: amavis
|
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Register razor
|
|
|
|
command: razor-admin -register chdir=/var/lib/amavis creates=/var/lib/amavis/.razor/identity
|
|
|
|
become: yes
|
|
|
|
become_user: amavis
|
|
|
|
tags: mail
|
|
|
|
|
2016-02-01 20:52:34 +01:00
|
|
|
- name: Start amavis
|
|
|
|
service: name=amavis state=started enabled=yes
|
|
|
|
tags: mail
|
2016-01-25 19:21:36 +01:00
|
|
|
|
|
|
|
- name: Start dovecot
|
|
|
|
service: name=dovecot state=started enabled=yes
|
2016-02-01 20:52:34 +01:00
|
|
|
tags: mail
|
2016-01-25 19:21:36 +01:00
|
|
|
|
|
|
|
- name: Start postfix
|
|
|
|
service: name=postfix state=started enabled=yes
|
2016-02-01 20:52:34 +01:00
|
|
|
tags: mail
|
|
|
|
|
|
|
|
- name: Start postgrey
|
|
|
|
service: name=postgrey state=started enabled=yes
|
|
|
|
tags: mail
|