diff --git a/handlers/main.yml b/handlers/main.yml index cd32b49..993ff5a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,3 +6,19 @@ enabled: yes listen: __ucs_apache_restart become: True + +- name: Restart dovecot service + service: + name: dovecot + state: restarted + enabled: yes + listen: __ucs_dovecot_restart + become: True + + - name: Restart postfix service + service: + name: postfix + state: restarted + enabled: yes + listen: __ucs_postfix_restart + become: True diff --git a/tasks/tls.yml b/tasks/tls.yml index a28df41..ffd47b3 100644 --- a/tasks/tls.yml +++ b/tasks/tls.yml @@ -21,7 +21,7 @@ label: "{{ item.dest }}" notify: __ucs_apache_restart - - name: Set necessary ucr vars + - name: Set apache2 ucr vars ucr: path: "{{ item.path }}" value: "{{ item.value }}" @@ -29,5 +29,23 @@ - { path: apache2/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" } - { path: apache2/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" } notify: __ucs_apache_restart + + - name: Set dovecot ucr vars + ucr: + path: "{{ item.path }}" + value: "{{ item.value }}" + with_items: + - { path: mail/dovecot/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" } + - { path: mail/dovecot/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" } + notify: __ucs_dovecot_restart + + - name: Set postfix ucr vars + ucr: + path: "{{ item.path }}" + value: "{{ item.value }}" + with_items: + - { path: mail/postfix/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" } + - { path: mail/postfix/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" } + notify: __ucs_postfix_restart become: True become_user: root