diff options
Diffstat (limited to 'roles/ssh-port-fwd-user/tasks/main.yaml')
-rw-r--r-- | roles/ssh-port-fwd-user/tasks/main.yaml | 9 |
1 files changed, 7 insertions, 2 deletions
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: |