45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
- name: install dovecot
|
|
apt:
|
|
pkg: "{{ item }}"
|
|
with_items:
|
|
- dovecot-common
|
|
- dovecot-imapd
|
|
- dovecot-managesieved
|
|
|
|
- name: add vmail group
|
|
group:
|
|
name: vmail
|
|
|
|
- name: add vmail user
|
|
user:
|
|
name: vmail
|
|
group: vmail
|
|
|
|
- name: copy dovecot config
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
with_items:
|
|
- { src: "dovecot.conf.j2", dest: "/etc/dovecot/dovecot.conf" }
|
|
- { src: "10-auth.conf.j2", dest: "/etc/dovecot/conf.d/10-auth.conf" }
|
|
- { src: "10-master.conf.j2", dest: "/etc/dovecot/conf.d/10-master.conf" }
|
|
- { src: "10-ssl.conf.j2", dest: "/etc/dovecot/conf.d/10-ssl.conf" }
|
|
- { src: "auth-system.conf.j2", dest: "/etc/dovecot/conf.d/auth-system.conf" }
|
|
notify:
|
|
- restart dovecot
|
|
|
|
- name: replace lines in config
|
|
lineinfile:
|
|
path: /etc/dovecot/conf.d/10-mail.conf
|
|
line: "mail_location = maildir:~/Maildir"
|
|
regexp: '^mail_location '
|
|
notify:
|
|
- restart dovecot
|
|
|
|
- name: setup dovecot users
|
|
template:
|
|
src: passwd.j2
|
|
dest: /etc/dovecot/passwd
|
|
owner: root
|
|
group: dovecot
|
|
mode: 0640
|