Skip to content

Commit 8f2dad0

Browse files
authored
Tweak handler to have a default state of restarted (#29)
1 parent 11cf510 commit 8f2dad0

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
BUG FIXES:
66

77
* Rename handlers to use more specific role related naming and prevent namespace collision issues.
8+
* Set NGINX handler to `state: restasted` to prevent some compatibility issues when NGINX App Protect is installed on an instance already running NGINX beforehand.
89

910
## 0.3.0 (September 21, 2020)
1011

handlers/main.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,21 @@
33
systemd:
44
daemon_reload: true
55

6+
- name: (Handler - NGINX App Protect) Restart NGINX
7+
service:
8+
name: nginx
9+
state: restarted
10+
enabled: true
11+
when:
12+
- nginx_app_protect_start | bool
13+
- not ansible_check_mode | bool
14+
listen: (Handler - NGINX App Protect) Run NGINX
15+
616
- name: (Handler - NGINX App Protect) Check NGINX
717
command: nginx -t
818
register: config
919
ignore_errors: true
20+
changed_when: false
1021
listen: (Handler - NGINX App Protect) Run NGINX
1122

1223
- name: (Handler - NGINX App Protect) Print NGINX error if syntax check fails
@@ -15,13 +26,3 @@
1526
failed_when: config.rc != 0
1627
when: config.rc != 0
1728
listen: (Handler - NGINX App Protect) Run NGINX
18-
19-
- name: (Handler - NGINX App Protect) Start/reload NGINX
20-
service:
21-
name: nginx
22-
state: reloaded
23-
enabled: true
24-
when:
25-
- nginx_app_protect_start | bool
26-
- not ansible_check_mode | bool
27-
listen: (Handler - NGINX App Protect) Run NGINX

0 commit comments

Comments
 (0)