xoxys.ucs/tasks/tls.yml

67 lines
2.3 KiB
YAML
Raw Normal View History

2018-08-04 22:23:06 +02:00
---
- block:
2019-01-09 22:33:12 +01:00
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
2021-02-04 22:55:00 +01:00
mode: 0700
2019-08-27 08:25:49 +02:00
loop:
2019-01-09 22:33:12 +01:00
- "{{ ucs_tls_certs_dir }}"
- "{{ ucs_tls_key_dir }}"
2018-08-04 22:23:06 +02:00
2019-01-09 22:33:12 +01:00
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
2019-01-09 22:36:29 +01:00
mode: "{{ item.mode }}"
2019-08-27 08:25:49 +02:00
loop:
2019-01-09 22:33:12 +01:00
- { src: "{{ ucs_tls_cert_path }}", dest: "{{ ucs_tls_certs_dir }}/ucs.pem", mode: '0600' }
- { src: "{{ ucs_tls_key_path }}", dest: "{{ ucs_tls_key_dir }}/ucs.pem", mode: '0750' }
loop_control:
label: "{{ item.dest }}"
notify:
- __ucs_apache_restart
- __ucs_dovecot_restart
- __ucs_postfix_restart
2018-08-04 22:48:43 +02:00
2019-01-09 22:33:12 +01:00
- name: Set apache2 ucr vars
ucr:
path: "{{ item.path }}"
value: "{{ item.value }}"
2019-08-27 08:25:49 +02:00
loop:
2019-01-09 22:33:12 +01:00
- { path: apache2/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" }
- { path: apache2/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" }
2024-03-26 11:46:54 +01:00
- { path: saml/apache2/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" }
- { path: saml/apache2/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" }
2019-01-09 22:33:12 +01:00
loop_control:
2019-01-09 22:36:29 +01:00
label: "variable: {{ item.path }}={{ item.value }}"
2019-01-09 22:33:12 +01:00
notify: __ucs_apache_restart
when: ucs_custom_tls_apache2_enabled
2018-08-04 23:30:31 +02:00
2019-01-09 22:33:12 +01:00
- name: Set dovecot ucr vars
ucr:
path: "{{ item.path }}"
value: "{{ item.value }}"
2019-08-27 08:25:49 +02:00
loop:
2019-01-09 22:33:12 +01:00
- { path: mail/dovecot/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" }
- { path: mail/dovecot/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" }
loop_control:
2019-01-09 22:36:29 +01:00
label: "variable: {{ item.path }}={{ item.value }}"
2019-01-09 22:33:12 +01:00
notify: __ucs_dovecot_restart
when: ucs_custom_tls_dovecot_enabled
2018-08-04 23:30:31 +02:00
2019-01-09 22:33:12 +01:00
- name: Set postfix ucr vars
ucr:
path: "{{ item.path }}"
value: "{{ item.value }}"
2019-08-27 08:25:49 +02:00
loop:
2019-01-09 22:33:12 +01:00
- { path: mail/postfix/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" }
- { path: mail/postfix/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" }
loop_control:
2019-01-09 22:36:29 +01:00
label: "variable: {{ item.path }}={{ item.value }}"
2019-01-09 22:33:12 +01:00
notify: __ucs_postfix_restart
when: ucs_custom_tls_postfix_enabled
2018-08-04 22:23:06 +02:00
become: True
become_user: root
2018-08-04 23:31:40 +02:00
when: ucs_custom_tls_enabled