94 lines
2.8 KiB
YAML
94 lines
2.8 KiB
YAML
---
|
|
- name: update apk cache
|
|
apk: update_cache=yes
|
|
|
|
- name: install packages
|
|
apk: name=postfix,postfix-pgsql,postfix-policyd-spf-perl,dovecot,dovecot-pgsql,dovecot-pigeonhole-plugin,clamav,freshclam,clamsmtp,gross,spamassassin,spamassassin-client,mailx,mutt state=present
|
|
|
|
- name: deploy main.cf
|
|
template: src=postfix/main.cf dest=/etc/postfix/main.cf
|
|
|
|
- name: deploy master.cf
|
|
template: src=postfix/master.cf dest=/etc/postfix/master.cf
|
|
|
|
- name: deploy pgsql-aliases.cf
|
|
template: src=postfix/pgsql-aliases.cf dest=/etc/postfix/pgsql-aliases.cf
|
|
|
|
- name: deploy pgsql-domains.cf
|
|
template: src=postfix/pgsql-domains.cf dest=/etc/postfix/pgsql-domains.cf
|
|
|
|
- name: deploy pgsql-maildir.cf
|
|
template: src=postfix/pgsql-maildir.cf dest=/etc/postfix/pgsql-maildir.cf
|
|
|
|
- name: deploy grossd.conf
|
|
template: src=gross/grossd.conf dest=/etc/grossd.conf
|
|
|
|
- name: deploy dovecot.conf
|
|
template: src=dovecot/dovecot.conf dest=/etc/dovecot/dovecot.conf
|
|
|
|
- name: deploy dovecot-sql.conf.ext
|
|
template: src=dovecot/dovecot-sql.conf.ext dest=/etc/dovecot/dovecot-sql.conf.ext
|
|
|
|
- name: create postfix spool dir
|
|
file: path=/var/spool/postfix state=directory owner=root group=root
|
|
|
|
- name: create postfix pid dir
|
|
file: path=/var/spool/postfix/pid state=directory owner=root group=root
|
|
|
|
- name: create dovecot log dir
|
|
file: path=/var/log/dovecot state=directory recurse=yes mode=0770 owner=dovecot group=mail
|
|
|
|
- name: create maildir
|
|
file: path=/var/spool/imap state=directory owner=mail group=mail
|
|
|
|
- name: deploy clamd.conf
|
|
copy: src=clamav/clamd.conf dest=/etc/clamav/clamd.conf mode=0600 owner=root group=root
|
|
|
|
- name: deploy feshclam.conf
|
|
copy: src=clamav/freshclam.conf dest=/etc/clamav/freshclam.conf mode=0600 owner=root group=root
|
|
|
|
- name: deploy clamsmtpd.conf
|
|
copy: src=clamsmtpd.conf dest=/etc/clamsmtpd.conf mode=0600 owner=root group=root
|
|
|
|
- name: generate dh512
|
|
command: openssl dhparam -out /etc/ssl/private/dh512.pem 512
|
|
|
|
- name: generate dh1024
|
|
command: openssl dhparam -out /etc/ssl/private/dh1024.pem 1024
|
|
|
|
- name: enable grossd
|
|
command: /sbin/rc-update add grossd
|
|
|
|
- name: enable clamd
|
|
command: /sbin/rc-update add clamd
|
|
|
|
- name: enable clamsmtpd
|
|
command: /sbin/rc-update add clamsmtpd
|
|
|
|
- name: enable spamd
|
|
command: /sbin/rc-update add spamd
|
|
|
|
- name: enable postfix
|
|
command: /sbin/rc-update add postfix
|
|
|
|
- name: enable dovecot
|
|
command: /sbin/rc-update add dovecot
|
|
|
|
- name: restart grossd
|
|
command: /sbin/rc-service grossd restart
|
|
|
|
- name: restart clamd
|
|
command: /sbin/rc-service clamd restart
|
|
|
|
- name: restart clamsmtpd
|
|
command: /sbin/rc-service clamsmtpd restart
|
|
|
|
- name: restart spamd
|
|
command: /sbin/rc-service spamd restart
|
|
|
|
- name: restart postfix
|
|
command: /sbin/rc-service postfix restart
|
|
|
|
- name: restart dovecot
|
|
command: /sbin/rc-service dovecot restart
|