From 87f68b2f87f9364bed766aff6f5f612d0c564f6a Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Sun, 12 Jul 2026 11:26:34 +0000 Subject: [PATCH] REFACTOR: harden_ssh task refactored according to ansible-lint --- roles/basic_postinstall/tasks/harden_ssh.yaml | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/roles/basic_postinstall/tasks/harden_ssh.yaml b/roles/basic_postinstall/tasks/harden_ssh.yaml index d4a2180..2f0a845 100644 --- a/roles/basic_postinstall/tasks/harden_ssh.yaml +++ b/roles/basic_postinstall/tasks/harden_ssh.yaml @@ -1,16 +1,24 @@ --- - name: Configure ssh-server daemon - copy: - src: ../files/hardened_sshd.conf + ansible.builtin.copy: + src: "{{ role_path }}/files/hardened_sshd.conf" dest: /etc/ssh/sshd_config.d/hardened_sshd.conf mode: u=rw,g=r,o=r - notify: restart sshd + notify: restart ssh-server + when: ansible_facts['distribution'] == 'Ubuntu' +- name: Configure ssh-server daemon + ansible.builtin.copy: + src: "{{ role_path }}/files/hardened_sshd.conf" + dest: /etc/ssh/sshd_config.d/hardened_sshd.conf + mode: u=rw,g=r,o=r + notify: restart sshd-server + when: ansible_facts['distribution'] == 'Debian' - name: Configure ssh client remote_user: ansible - copy: - src: ../files/hardened_ssh.conf + ansible.builtin.copy: + src: "{{ role_path }}/files/hardened_ssh.conf" dest: /etc/ssh/ssh_config.d/hardened_ssh.conf - mode: u=rw,g=r,o=r \ No newline at end of file + mode: u=rw,g=r,o=r