ansible-role-nginx/handlers/main.yml
Alessandro Fael Garcia bf2916fc55
Update Ansible to 2.9.12 and explicitly set mode on relevant tasks (#309)
*   Explicitly define `mode` in relevant tasks.
*   Explicitly define the `nginx` `apt_repository` filename in Debian based distros.
*   Building OpenSSL from source should now work properly in CentOS 8.
2020-08-28 10:30:23 +02:00

46 lines
1.0 KiB
YAML

---
- name: "(Handler: All OSs) Check NGINX"
command: "nginx -t"
changed_when: false
- name: "(Handler: All OSs) Systemd Daemon-Reload"
systemd:
daemon_reload: yes
notify: "(Handler: All OSs) Start NGINX"
- name: "(Handler: All OSs) Run NGINX"
block:
- name: "(Handler: All OSs) Start NGINX"
service:
name: nginx
state: started
enabled: yes
notify: "(Handler: All OSs) Check NGINX"
- name: "(Handler: All OSs) Reload NGINX"
command: "nginx -s reload"
changed_when: false
when:
- nginx_start | bool
- not ansible_check_mode | bool
- name: "(Handler: All OSs) Start NGINX Amplify Agent"
service:
name: amplify-agent
state: started
- 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
- name: "(Config: All OSs) Run Logrotate"
command: logrotate -f /etc/logrotate.d/nginx