main.yml (290B)
1 --- 2 - name: Validate nginx before restart 3 ansible.builtin.command: nginx -c /etc/nginx/nginx.conf -t 4 changed_when: false 5 check_mode: false 6 listen: Restart nginx 7 8 - name: Restart validated nginx 9 ansible.builtin.service: 10 name: nginx 11 state: restarted 12 listen: Restart nginx