Restart nginx on SSL file writes

pull/35/head
Emilien Mantel 2017-11-03 10:30:24 +01:00
parent 8675d683ec
commit 57968b50c0
2 changed files with 13 additions and 5 deletions

View File

@ -1,15 +1,23 @@
--- ---
# Reload wrapper
- name: reload nginx - name: reload nginx
command: nginx -t command: nginx -t
notify: real-reload nginx notify: real-reload nginx
- name: restart nginx
command: nginx -t
notify: real-restart nginx
- name: real-reload nginx - name: real-reload nginx
service: service:
name: nginx name: nginx
state: reloaded state: reloaded
- name: real-restart nginx
service:
name: nginx
state: restarted
- name: restart nginx freebsd - name: restart nginx freebsd
service: service:
name: nginx name: nginx

View File

@ -5,7 +5,7 @@
args: args:
creates: "{{ nginx_dh_path }}" creates: "{{ nginx_dh_path }}"
when: nginx_dh is not string when: nginx_dh is not string
notify: reload nginx notify: restart nginx
async: 1000 async: 1000
register: dh register: dh
@ -14,7 +14,7 @@
content: "{{ nginx_dh }}" content: "{{ nginx_dh }}"
dest: "{{ nginx_dh_path }}" dest: "{{ nginx_dh_path }}"
when: nginx_dh is string when: nginx_dh is string
notify: reload nginx notify: restart nginx
- name: FILE | Create SSL directories - name: FILE | Create SSL directories
file: file:
@ -31,7 +31,7 @@
mode: 0640 mode: 0640
with_items: "{{ nginx_ssl_pairs }}" with_items: "{{ nginx_ssl_pairs }}"
when: item.key is defined when: item.key is defined
notify: reload nginx notify: restart nginx
no_log: true no_log: true
- name: COPY | Deploy SSL certs - name: COPY | Deploy SSL certs
@ -41,7 +41,7 @@
mode: 0644 mode: 0644
with_items: "{{ nginx_ssl_pairs }}" with_items: "{{ nginx_ssl_pairs }}"
when: item.cert is defined when: item.cert is defined
notify: reload nginx notify: restart nginx
no_log: true no_log: true
- name: Check DH command status - name: Check DH command status