diff --git a/handlers/main.yml b/handlers/main.yml index 6aece4f..fe201d3 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,4 @@ - name: restart sshd ansible.builtin.service: - name: "{{ ssh_service }}" + name: sshd state: restarted diff --git a/tasks/Arch.yml b/tasks/Arch.yml index 2b831de..0b999d4 100644 --- a/tasks/Arch.yml +++ b/tasks/Arch.yml @@ -2,12 +2,3 @@ ansible.builtin.package: name: openssh state: present - -- set_fact: - ssh_service: sshd - -- name: Enable service. - ansible.builtin.service: - name: "{{ ssh_service }}" - enabled: true - state: started diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 45779c0..1cecdb9 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -2,12 +2,3 @@ ansible.builtin.package: name: ssh state: present - -- set_fact: - ssh_service: sshd - -- name: Enable service. - ansible.builtin.service: - name: "{{ ssh_service }}" - enabled: true - state: started diff --git a/tasks/Raspbian.yml b/tasks/Raspbian.yml index 45779c0..1cecdb9 100644 --- a/tasks/Raspbian.yml +++ b/tasks/Raspbian.yml @@ -2,12 +2,3 @@ ansible.builtin.package: name: ssh state: present - -- set_fact: - ssh_service: sshd - -- name: Enable service. - ansible.builtin.service: - name: "{{ ssh_service }}" - enabled: true - state: started diff --git a/tasks/main.yml b/tasks/main.yml index d2bbc1d..0e856bc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,11 @@ - ansible.builtin.include_tasks: "{{ ansible_lsb['id'] }}.yml" +- name: Enable service. + ansible.builtin.service: + name: sshd + enabled: true + state: started + - name: Ensure sshd_config is setup. ansible.builtin.lineinfile: path: /etc/ssh/sshd_config