- name: Check sshd shell: cmd: sshd -t become: yes listen: "restart_sshd" - name: Restart sshd service: name: sshd state: restarted become: yes listen: "restart_sshd"