summaryrefslogtreecommitdiffstats
path: root/roles/webmail/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/webmail/tasks')
-rw-r--r--roles/webmail/tasks/mail.yml27
1 files changed, 10 insertions, 17 deletions
diff --git a/roles/webmail/tasks/mail.yml b/roles/webmail/tasks/mail.yml
index 7603a56..78eee38 100644
--- a/roles/webmail/tasks/mail.yml
+++ b/roles/webmail/tasks/mail.yml
@@ -1,13 +1,3 @@
-- name: Install stunnel
- apt: pkg=stunnel4
-
-- name: Auto-enable stunnel
- lineinfile: dest=/etc/default/stunnel4
- regexp='^(\s*#)?\s*ENABLED='
- line='ENABLED=1'
- owner=root group=root
- mode=0644
-
- name: Create /etc/stunnel/certs
file: path=/etc/stunnel/certs
state=directory
@@ -16,24 +6,27 @@
- name: Copy the SMTP outgoing proxy's X.509 certificate
assemble: src=certs/postfix regexp="{{ groups.out | difference([inventory_hostname]) | join('|') }}\.pem$" remote_src=no
- dest=/etc/stunnel/certs/postfix.pem
+ dest=/etc/stunnel/certs/smtp.pem
owner=root group=root
mode=0644
register: r1
notify:
- - Restart stunnel
+ - Restart stunnel@smtp
- name: Configure stunnel
- template: src=etc/stunnel/postfix.conf.j2
- dest=/etc/stunnel/postfix.conf
+ template: src=etc/stunnel/smtp.conf.j2
+ dest=/etc/stunnel/smtp.conf
owner=root group=root
mode=0644
register: r2
notify:
- - Restart stunnel
+ - Restart stunnel@smtp
+
+- name: Enable stunnel@smtp
+ service: name=stunnel4@smtp enabled=yes
-- name: Start stunnel
- service: name=stunnel4 pattern=/usr/bin/stunnel4 state=started
+- name: Start stunnel@smtp
+ service: name=stunnel4@smtp state=started
when: not (r1.changed or r2.changed)
- meta: flush_handlers