Skip to content

Commit 5b56f01

Browse files
committed
Fix sshd handlers for Debian 12.
Debian 12, Ubuntu 22 and above need to re-run systemd generators to pull the updated sshd port config. https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189/14
1 parent 3b5b2e9 commit 5b56f01

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

handlers/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
- name: systemd reload
3+
ansible.builtin.command: systemctl daemon-reload
24
- name: restart ssh
35
service:
46
name: "{{ security_sshd_name }}"

tasks/ssh.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
line: "GSSAPIAuthentication {{ security_ssh_gss_api_authentication }}"
3030
- regexp: "^X11Forwarding"
3131
line: "X11Forwarding {{ security_ssh_x11_forwarding }}"
32-
notify: restart ssh
32+
notify: "{{ security_sshd_handlers }}"
3333

3434
- name: Add configured users allowed to connect over ssh
3535
lineinfile:

vars/Debian.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
---
22
security_ssh_config_path: /etc/ssh/sshd_config
33
security_sshd_name: ssh
4+
security_sshd_handlers:
5+
- restart ssh
6+
- systemd reload

vars/RedHat.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
security_ssh_config_path: /etc/ssh/sshd_config
33
security_sshd_name: sshd
4+
security_sshd_handlers: restart ssh

0 commit comments

Comments
 (0)