--- - name: "[OpenRC] Restart service: sshd (to deploy config changes)" service: name: sshd state: restarted when: - ansible_service_mgr == "openrc" listen: "Restart openssh" - name: "[systemd] Restart service: sshd (to deploy config changes)" systemd: name: sshd state: restarted when: - ansible_service_mgr == "systemd" listen: "Restart openssh"