mirror of
https://github.com/geerlingguy/ansible-role-nginx.git
synced 2024-11-16 10:35:33 +01:00
Remove new config validation, Fix #41
NOTE: current nginx config validation process breaks SELinux context for pid file, as described in #41 Restart of nginx is not needed for configuration changes and is replaced with reload, which will validate config before applying it, leaving running nginx process untouched in case of any validation errors. Restart handler left in support.
This commit is contained in:
parent
357ab200f7
commit
5294d77fa3
@ -5,3 +5,6 @@
|
|||||||
- name: validate nginx configuration
|
- name: validate nginx configuration
|
||||||
command: nginx -t -c /etc/nginx/nginx.conf
|
command: nginx -t -c /etc/nginx/nginx.conf
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
|
- name: reload nginx
|
||||||
|
service: name=nginx state=reloaded
|
||||||
|
@ -26,10 +26,8 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
validate: 'nginx -t -c %s'
|
|
||||||
notify:
|
notify:
|
||||||
- validate nginx configuration
|
- reload nginx
|
||||||
- restart nginx
|
|
||||||
|
|
||||||
- name: Ensure nginx is started and enabled to start at boot.
|
- name: Ensure nginx is started and enabled to start at boot.
|
||||||
service: name=nginx state=started enabled=yes
|
service: name=nginx state=started enabled=yes
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
state: absent
|
state: absent
|
||||||
when: nginx_remove_default_vhost
|
when: nginx_remove_default_vhost
|
||||||
notify:
|
notify:
|
||||||
- validate nginx configuration
|
- reload nginx
|
||||||
- restart nginx
|
|
||||||
|
|
||||||
- name: Add managed vhost config file (if any vhosts are configured).
|
- name: Add managed vhost config file (if any vhosts are configured).
|
||||||
template:
|
template:
|
||||||
@ -15,8 +14,7 @@
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
when: nginx_vhosts|length > 0
|
when: nginx_vhosts|length > 0
|
||||||
notify:
|
notify:
|
||||||
- validate nginx configuration
|
- reload nginx
|
||||||
- restart nginx
|
|
||||||
|
|
||||||
- name: Remove managed vhost config file (if no vhosts are configured).
|
- name: Remove managed vhost config file (if no vhosts are configured).
|
||||||
file:
|
file:
|
||||||
@ -24,6 +22,5 @@
|
|||||||
state: absent
|
state: absent
|
||||||
when: nginx_vhosts|length == 0
|
when: nginx_vhosts|length == 0
|
||||||
notify:
|
notify:
|
||||||
- validate nginx configuration
|
- reload nginx
|
||||||
- restart nginx
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user