REFACTOR: handlers moved from LXC setting up playbook to harden ssh task

This commit is contained in:
2026-07-12 15:54:39 +00:00
parent d1568586e9
commit 37aeddca6c
2 changed files with 15 additions and 14 deletions
+14 -2
View File
@@ -5,7 +5,6 @@
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 ssh-server
when: ansible_facts['distribution'] == 'Ubuntu'
- name: Configure ssh-server daemon
@@ -13,7 +12,6 @@
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
@@ -22,3 +20,17 @@
src: "{{ role_path }}/files/hardened_ssh.conf"
dest: /etc/ssh/ssh_config.d/hardened_ssh.conf
mode: u=rw,g=r,o=r
- name: Restart ssh-server Debian
remote_user: ansible
ansible.builtin.service:
name: sshd
state: restarted
when: ansible_facts['distribution'] == 'Debian'
- name: Restart ssh-server Ubuntu
remote_user: ansible
ansible.builtin.service:
name: ssh
state: restarted
when: ansible_facts['distribution'] == 'Ubuntu'