2018-10-22 08:56:39 +00:00
|
|
|
---
|
2018-08-11 12:59:43 +00:00
|
|
|
- block:
|
2019-03-25 21:23:40 +00:00
|
|
|
- name: Copy certs and private key
|
2018-10-22 08:56:39 +00:00
|
|
|
copy:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
2019-03-25 21:23:40 +00:00
|
|
|
loop:
|
2018-10-22 08:56:39 +00:00
|
|
|
- { src: "{{ nginx_tls_key_source }}", dest: '/etc/pki/tls/private/{{ nginx_tls_key_file }}', mode: '0600' }
|
|
|
|
- { src: "{{ nginx_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ nginx_tls_cert_file }}', mode: '0750' }
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
notify: __nginx_reload
|
2019-05-19 20:49:00 +00:00
|
|
|
when: nginx_tls_source_use_files | bool
|
2018-12-09 21:29:26 +00:00
|
|
|
|
2018-12-09 22:12:03 +00:00
|
|
|
- name: Create Diffie-Hellman Parameter
|
|
|
|
openssl_dhparam:
|
|
|
|
path: "{{ nginx_tls_dhparam_file }}"
|
|
|
|
size: "{{ nginx_tls_dhparam_size | default('2048') }}"
|
|
|
|
when: nginx_tls_dhparam_file is defined
|
|
|
|
|
2018-12-09 21:29:26 +00: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
|
|
|
|
validate: bash -c 'nginx -t -c /dev/stdin <<< "events {worker_connections 1;} http { include %s; }"'
|
|
|
|
notify: __nginx_reload
|
2018-08-11 12:59:43 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|