xoxys.nginx/tasks/tls.yml

34 lines
1.0 KiB
YAML
Raw Normal View History

2018-10-22 08:56:39 +00:00
---
2018-08-11 12:59:43 +00:00
- block:
- name: Copy certs and private key
2018-10-22 08:56:39 +00:00
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
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 }}"
2019-07-18 06:59:41 +00:00
when:
- nginx_tls_cert_source is defined
- nginx_tls_key_source is defined
2018-10-22 08:56:39 +00:00
notify: __nginx_reload
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 }}"
2019-07-18 06:59:41 +00:00
size: "{{ nginx_tls_dhparam_size }}"
2018-12-09 22:12:03 +00:00
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
notify: __nginx_reload
2018-08-11 12:59:43 +00:00
become: True
become_user: root