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