From 2284a02d725fcc5672b53eb7f0279f5108a46760 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Fri, 4 Oct 2024 23:05:14 +0200 Subject: [PATCH] aouaou Signed-off-by: Frank Villaro-Dixon --- handlers/main.yml | 9 ++++++++- tasks/ssh.yml | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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