diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2013-12-02 20:18:28 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:51:08 +0200 |
commit | 7d1622f3e5db18b40cab6cecfd3c2f1fab20d782 (patch) | |
tree | c5753fb80444467fe2fcb205e4d03595ff1412de /roles/IMAP/tasks | |
parent | f2dc55cd77aae4e6e9c4258a64547a16a90ea579 (diff) |
Configure the IMAP server.
(For now, only LMTP and IMAP processes, without replication.)
Diffstat (limited to 'roles/IMAP/tasks')
-rw-r--r-- | roles/IMAP/tasks/imap.yml | 49 | ||||
-rw-r--r-- | roles/IMAP/tasks/main.yml | 2 |
2 files changed, 51 insertions, 0 deletions
diff --git a/roles/IMAP/tasks/imap.yml b/roles/IMAP/tasks/imap.yml new file mode 100644 index 0000000..554bc67 --- /dev/null +++ b/roles/IMAP/tasks/imap.yml @@ -0,0 +1,49 @@ +- name: Install Dovecot + apt: pkg={{ item }} + with_items: + - dovecot-core + - dovecot-ldap + - dovecot-imapd + - dovecot-lmtpd + +- name: Create a user 'vmail' + user: name=vmail system=yes + home=/home/mail + shell=/bin/false + password=! + state=present + +- name: Create directories for user 'vmail' + file: path=/home/mail{{ item }} + owner=vmail group=vmail + state=directory + mode=0700 + with_items: + - / + - /mailboxes + - /sieve + +- name: Configure Dovecot + copy: src=etc/dovecot/{{ item }} + dest=/etc/dovecot/{{ item }} + owner=root group=root + mode=0644 + register: r + with_items: + - conf.d/10-auth.conf + - conf.d/10-logging.conf + - conf.d/10-mail.conf + - conf.d/10-master.conf + - conf.d/10-ssl.conf + - conf.d/15-mailboxes.conf + - conf.d/20-lmtp.conf + - conf.d/auth-ldap.conf.ext + - dovecot-ldap.conf.ext + notify: + - Restart Dovecot + +- name: Start Dovecot + service: name=dovecot state=started + when: not r.changed + +- meta: flush_handlers diff --git a/roles/IMAP/tasks/main.yml b/roles/IMAP/tasks/main.yml new file mode 100644 index 0000000..d71573e --- /dev/null +++ b/roles/IMAP/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: imap.yml tags=imap,dovecot |