1 2 3 4 5 6
- name: restart ssh systemd: name: ssh state: restarted enabled: true when: ansible_facts['service_mgr'] == 'systemd'