Skip to content

Commit e9597d0

Browse files
committed
validate nginx before config as second layer
1 parent 113042c commit e9597d0

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

handlers/main.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
---
2+
3+
- name: check restart nginx
4+
command:
5+
nginx -t -c "{{ nginx_etc }}/nginx.conf"
6+
changed_when: True
7+
notify:
8+
- restart nginx
9+
10+
- name: check reload nginx
11+
command:
12+
nginx -t -c "{{ nginx_etc }}/nginx.conf"
13+
changed_when: True
14+
notify:
15+
- reload nginx
16+
217
- name: restart nginx
318
service:
4-
name=nginx
5-
state=restarted
19+
name=nginx
20+
state=restarted
621

722
- name: reload nginx
823
service:
9-
name=nginx
10-
state=reloaded
24+
name=nginx
25+
state=reloaded

0 commit comments

Comments
 (0)