xoxys.nginx/tasks/tls.yml

38 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: Ensur target directories exist for certificate files
file:
name: "{{ item.dest | dirname }}"
state: directory
loop: "{{ nginx_tls_certificates }}"
loop_control:
label: "{{ item.dest }}"
- name: Copy certificate files
2018-10-22 08:56:39 +00:00
copy:
src: "{{ item.source }}"
2018-10-22 08:56:39 +00:00
dest: "{{ item.dest }}"
mode: "{{ item.mode | default('0600') }}"
owner: "{{ item.owner | default('root') }}"
loop: "{{ nginx_tls_certificates }}"
2018-10-22 08:56:39 +00:00
loop_control:
label: "{{ item.dest }}"
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