1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- name: Check nginx config for errors
shell: nginx -t
changed_when: True
listen: "Restart nginx"
- name: "[OpenRC] Restart service: nginx (to deploy config changes)"
service:
name: nginx
state: restarted
when:
- ansible_service_mgr == "openrc"
listen: "Restart nginx"
- name: "[systemd] Restart service: nginx (to deploy config changes)"
systemd:
name: nginx
state: restarted
when:
- ansible_service_mgr == "systemd"
listen: "Restart nginx"