ansible-role-nginx/handlers/main.yml

46 lines
972 B
YAML
Raw Normal View History

2018-01-10 23:40:01 +01:00
---
2020-09-15 21:27:06 +02:00
- name: "(Handler) Check NGINX"
command: "nginx -t"
changed_when: false
2020-09-15 21:27:06 +02:00
- name: "(Handler) Systemd Daemon-Reload"
systemd:
daemon_reload: yes
2020-09-15 21:27:06 +02:00
notify: "(Handler) Start NGINX"
2020-09-15 21:27:06 +02:00
- name: "(Handler) Run NGINX"
block:
2020-09-15 21:27:06 +02:00
- name: "(Handler) Start NGINX"
service:
name: nginx
state: started
enabled: yes
2020-09-15 21:27:06 +02:00
notify: "(Handler) Check NGINX"
2018-04-07 01:32:48 +02:00
2020-09-15 21:27:06 +02:00
- name: "(Handler) Reload NGINX"
2020-04-21 20:52:31 +02:00
command: "nginx -s reload"
changed_when: false
when:
- nginx_start | bool
- not ansible_check_mode | bool
2020-09-15 21:27:06 +02:00
- name: "(Handler) Start NGINX Amplify agent"
service:
name: amplify-agent
state: started
2018-07-18 23:59:14 +02:00
- name: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
service:
name: unit
state: started
enabled: yes
- name: "(Handler: FreeBSD) Start NGINX Unit"
service:
name: unitd
state: started
enabled: yes
2020-09-15 21:27:06 +02:00
- name: "(Handler) Run logrotate"
command: logrotate -f /etc/logrotate.d/nginx