From b8f1d76bd38d03e68fbc51f8e7340a9963a4104d Mon Sep 17 00:00:00 2001 From: heqnx Date: Thu, 29 May 2025 19:34:32 +0300 Subject: removed handlers, need to run all the time --- roles/ssh-port-fwd-user/tasks/main.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'roles/ssh-port-fwd-user/tasks/main.yaml') diff --git a/roles/ssh-port-fwd-user/tasks/main.yaml b/roles/ssh-port-fwd-user/tasks/main.yaml index 85d7a97..de6b9b8 100644 --- a/roles/ssh-port-fwd-user/tasks/main.yaml +++ b/roles/ssh-port-fwd-user/tasks/main.yaml @@ -64,7 +64,6 @@ owner: root group: root mode: '0644' - notify: restart ssh - name: ensure /etc/ssh/sshd_config includes .d directory lineinfile: @@ -72,7 +71,13 @@ regexp: '^Include /etc/ssh/sshd_config\.d/\*\.conf' line: 'Include /etc/ssh/sshd_config.d/*.conf' insertafter: EOF - notify: restart ssh + +- name: restart ssh + systemd: + name: ssh + state: restarted + enabled: true + when: ansible_service_mgr == 'systemd' - name: fetch private key to control node fetch: -- cgit v1.2.3