2018-01-10 23:40:01 +01:00
|
|
|
---
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(Handler) Check NGINX"
|
2020-06-30 18:59:53 +02:00
|
|
|
command: "nginx -t"
|
2020-09-17 17:00:27 +02:00
|
|
|
register: config
|
|
|
|
ignore_errors: yes
|
|
|
|
listen: "(Handler) Run NGINX"
|
2020-06-30 18:59:53 +02:00
|
|
|
|
2020-09-17 17:00:27 +02:00
|
|
|
- name: "(Handler) Print NGINX error if syntax check fails"
|
2020-09-18 19:51:50 +02:00
|
|
|
debug:
|
|
|
|
var: config.stderr_lines
|
|
|
|
failed_when: config.rc != 0
|
2020-09-17 17:00:27 +02:00
|
|
|
when: config.rc != 0
|
|
|
|
listen: "(Handler) Run NGINX"
|
|
|
|
|
|
|
|
- name: "(Handler) Systemd daemon-reload"
|
2020-06-30 18:59:53 +02:00
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
2018-04-07 01:32:48 +02:00
|
|
|
|
2020-09-17 17:00:27 +02:00
|
|
|
- name: "(Handler) Start/Reload NGINX"
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: reloaded
|
|
|
|
enabled: yes
|
2019-11-18 21:09:10 +01:00
|
|
|
when:
|
|
|
|
- nginx_start | bool
|
2020-08-28 10:30:23 +02:00
|
|
|
- not ansible_check_mode | bool
|
2020-09-17 17:00:27 +02:00
|
|
|
listen: "(Handler) Run NGINX"
|
2018-09-12 23:03:20 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(Handler) Start NGINX Amplify agent"
|
2019-08-03 12:53:21 +02:00
|
|
|
service:
|
|
|
|
name: amplify-agent
|
|
|
|
state: started
|
2018-07-18 23:59:14 +02:00
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(DEPRECATED Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
|
2019-08-03 12:53:21 +02:00
|
|
|
service:
|
|
|
|
name: unit
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(DEPRECATED Handler: FreeBSD) Start NGINX Unit"
|
2019-08-03 12:53:21 +02:00
|
|
|
service:
|
|
|
|
name: unitd
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2020-08-20 01:50:22 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(Handler) Run logrotate"
|
2020-08-20 01:50:22 +02:00
|
|
|
command: logrotate -f /etc/logrotate.d/nginx
|