2018-10-22 10:56:39 +02:00
|
|
|
---
|
2018-08-11 14:59:43 +02:00
|
|
|
- block:
|
2020-06-04 23:09:15 +02:00
|
|
|
- name: Ensur target directories exist for certificate files
|
|
|
|
file:
|
|
|
|
name: "{{ item.dest | dirname }}"
|
|
|
|
state: directory
|
2020-06-04 23:37:44 +02:00
|
|
|
loop: "{{ nginx_tls_certificates + nginx_tls_certificates_extra }}"
|
2020-06-04 23:09:15 +02:00
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
|
|
|
|
- name: Copy certificate files
|
2018-10-22 10:56:39 +02:00
|
|
|
copy:
|
2020-06-04 23:09:15 +02:00
|
|
|
src: "{{ item.source }}"
|
2018-10-22 10:56:39 +02:00
|
|
|
dest: "{{ item.dest }}"
|
2020-06-04 23:09:15 +02:00
|
|
|
mode: "{{ item.mode | default('0600') }}"
|
|
|
|
owner: "{{ item.owner | default('root') }}"
|
2020-06-04 23:37:44 +02:00
|
|
|
loop: "{{ nginx_tls_certificates + nginx_tls_certificates_extra }}"
|
2018-10-22 10:56:39 +02:00
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
notify: __nginx_reload
|
2018-12-09 22:29:26 +01:00
|
|
|
|
2018-12-09 23:12:03 +01:00
|
|
|
- name: Create Diffie-Hellman Parameter
|
|
|
|
openssl_dhparam:
|
|
|
|
path: "{{ nginx_tls_dhparam_file }}"
|
2019-07-18 08:59:41 +02:00
|
|
|
size: "{{ nginx_tls_dhparam_size }}"
|
2018-12-09 23:12:03 +01:00
|
|
|
when: nginx_tls_dhparam_file is defined
|
|
|
|
|
2018-12-09 22:29:26 +01:00
|
|
|
- name: Update tls.conf
|
|
|
|
template:
|
|
|
|
src: etc/nginx/conf.d/tls.conf.j2
|
|
|
|
dest: /etc/nginx/conf.d/tls.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0640
|
|
|
|
notify: __nginx_reload
|
2018-08-11 14:59:43 +02:00
|
|
|
become: True
|
|
|
|
become_user: root
|