diff --git a/handlers/main.yml b/handlers/main.yml index aa4412e..4f94973 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -16,4 +16,11 @@ - name: restart sshd systemd: name: sshd - state: restarted \ No newline at end of file + state: restarted + when: ansible_os_family == 'Archlinux' + +- name: restart ssh + systemd: + name: ssh + state: restarted + when: ansible_os_family == 'Debian' \ No newline at end of file diff --git a/tasks/ssh.yml b/tasks/ssh.yml index b3fb413..a9a07e3 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -22,8 +22,16 @@ group: root mode: '0600' +- name: Ensure ssh service is started and enabled + systemd: + name: ssh + enabled: yes + state: started + when: ansible_os_family == 'Debian' + - name: Ensure sshd service is started and enabled systemd: name: sshd enabled: yes - state: started \ No newline at end of file + state: started + when: ansible_os_family == 'Archlinux' \ No newline at end of file