Reload nginx when the conf snippets change.

This commit is contained in:
Andrea Dell'Amico 2018-03-13 12:14:27 +01:00
parent dab8ed95a4
commit e558b25cda
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@
- name: Install the supported configuration snippets - name: Install the supported configuration snippets
template: src={{ item }}.j2 dest=/etc/nginx/snippets/{{ item }} owner=root group=root mode=0444 template: src={{ item }}.j2 dest=/etc/nginx/snippets/{{ item }} owner=root group=root mode=0444
with_items: '{{ nginx_conf_snippets }}' with_items: '{{ nginx_conf_snippets }}'
notify: Reload nginx
- name: Install the main nginx.conf - name: Install the main nginx.conf
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444 template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444
@ -32,6 +33,7 @@
- name: Remove the old configuration snippets - name: Remove the old configuration snippets
file: dest=/etc/nginx/conf.d/{{ item }} state=absent file: dest=/etc/nginx/conf.d/{{ item }} state=absent
with_items: '{{ nginx_old_snippets }}' with_items: '{{ nginx_old_snippets }}'
notify: Reload nginx
when: nginx_enabled when: nginx_enabled
tags: [ 'nginx', 'nginx_conf', 'nginx_virtualhost' ] tags: [ 'nginx', 'nginx_conf', 'nginx_virtualhost' ]