--- - name: "[OpenRC] Restart service: acme-redirect (to deploy config changes)" service: name: acme-redirect state: restarted when: - ansible_service_mgr == "openrc" listen: "Restart acme-redirect" - name: "[systemd] Restart service: acme-redirect (to deploy config changes)" systemd: name: acme-redirect state: restarted when: - ansible_service_mgr == "systemd" listen: "Restart acme-redirect" - name: "Check that all defined domains are pointing to this server" command: cmd: acme-redirect check -q register: acme_check become: yes become_user: acme-redirect listen: "Restart acme-redirect" - fail: msg: "Check of domains failed: {{acme_check.stdout}}" when: - acme_check.stdout | length > 0 listen: "Restart acme-redirect" - name: "Renew(or create) certs" command: cmd: acme-redirect renew -q register: acme_renew become: yes become_user: acme-redirect listen: "Restart acme-redirect" - fail: msg: "Renew of certs failed: {{acme_renew.stdout}}" when: - acme_renew.stdout | length > 0 listen: "Restart acme-redirect"