ansible-role-mailserver/tasks/dovecot.yml

59 lines
1.2 KiB
YAML
Raw Normal View History

2020-07-22 23:20:10 +02:00
- name: dovecot - install
2020-07-20 09:46:16 +02:00
package:
state: latest
name:
- dovecot
- pigeonhole
2020-07-22 21:37:04 +02:00
2020-07-22 23:20:10 +02:00
- name: dovecot - generate DH
notify: restart dovecot
openssl_dhparam:
path: /etc/dovecot/dh.pem
size: 4096
- name: dovecot - create config folder
notify: restart dovecot
2020-07-22 21:37:04 +02:00
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /etc/dovecot
- /etc/dovecot/conf.d
2020-07-22 23:20:10 +02:00
- name: dovecot - take default config
notify: restart dovecot
2020-07-22 21:37:04 +02:00
copy:
remote_src: yes
src: "/usr/share/doc/dovecot/example-config/{{ item }}"
dest: "/etc/dovecot/{{ item }}"
with_items:
- conf.d/auth-sql.conf.ext
2020-07-22 23:20:10 +02:00
- name: dovecot - config
notify: restart dovecot
2020-07-22 21:37:04 +02:00
template:
src: "dovecot/{{ item }}"
dest: "/etc/dovecot/{{ item }}"
with_items:
- dovecot-sql.conf.ext
- dovecot.conf
- conf.d/10-auth.conf
2020-07-22 23:20:10 +02:00
- conf.d/10-mail.conf
- conf.d/10-master.conf
- conf.d/10-ssl.conf
- conf.d/15-mailboxes.conf
- conf.d/20-imap.conf
- conf.d/20-lmtp.conf
- conf.d/20-managesieve.conf
- conf.d/90-quota.conf
- conf.d/90-sieve.conf
- conf.d/91-stats.conf
2020-07-22 21:37:04 +02:00
2020-07-22 23:20:10 +02:00
- name: dovecot - start and enable on boot
systemd:
name: dovecot
enabled: yes
state: restarted