initial commit

This commit is contained in:
nd 2018-01-17 17:11:07 +01:00
commit 9036a73324
8 changed files with 548 additions and 0 deletions

45
tasks/main.yml Normal file
View file

@ -0,0 +1,45 @@
- 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