From 73b2a602ee85706b2a1797632142058c6253ea5d Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 22 May 2016 18:02:37 +0200 Subject: dovecot: also listen on the virtual IP dedicated to IPSec. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (On port 143.) Moreover, add the whole IPSec virtual subnet to ‘login_trusted_networks’ since our IPSec tunnels provide end-to-end encryption and we therefore don't need the extra SSL/TLS protection. --- roles/IMAP/tasks/imap.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'roles/IMAP/tasks') diff --git a/roles/IMAP/tasks/imap.yml b/roles/IMAP/tasks/imap.yml index 39dc573..a596c42 100644 --- a/roles/IMAP/tasks/imap.yml +++ b/roles/IMAP/tasks/imap.yml @@ -96,7 +96,6 @@ - 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-imap.conf @@ -109,23 +108,33 @@ notify: - Restart Dovecot +- name: Configure Dovecot (2) + template: src=etc/dovecot/{{ item }}.j2 + dest=/etc/dovecot/{{ item }} + owner=root group=root + mode=0644 + register: r2 + with_items: + - conf.d/10-master.conf + notify: + - Restart Dovecot + - name: Tell Dovecot we have a remote IMAP proxy - # XXX: we should have an automatic lookup here lineinfile: dest=/etc/dovecot/dovecot.conf regexp='^(\s*#)?\s*login_trusted_networks\s*=' - line='login_trusted_networks = 171.25.193.76/32' + line="login_trusted_networks = {{ ipsec_subnet }}" state=present create=yes owner=root group=root mode=0644 - register: r2 - when: "'IMAP' in group_names and 'webmail' not in group_names" + register: r3 + when: "groups.all | length > 1" notify: - Restart Dovecot - name: Start Dovecot service: name=dovecot state=started - when: not (r1.changed or r2.changed) + when: not (r1.changed or r2.changed or r3.changed) - meta: flush_handlers -- cgit v1.2.3