diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-09-22 10:07:20 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-09-22 11:14:27 +0200 |
commit | 6431483d6f1642e57c1e3d00ade5cf72910b7894 (patch) | |
tree | 484f0aa379ccb65a7296deda6c350b8156aa7708 /roles/sshd/tasks/main.yml | |
parent | journald: move service restart to handlers (diff) | |
download | infra-ansible-6431483d6f1642e57c1e3d00ade5cf72910b7894.tar.gz infra-ansible-6431483d6f1642e57c1e3d00ade5cf72910b7894.zip |
sshd: move service restart to handlers
Diffstat (limited to 'roles/sshd/tasks/main.yml')
-rw-r--r-- | roles/sshd/tasks/main.yml | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml index fb8d7cc..46eb0e1 100644 --- a/roles/sshd/tasks/main.yml +++ b/roles/sshd/tasks/main.yml @@ -7,11 +7,7 @@ group: root mode: '644' validate: /usr/sbin/sshd -t -f %s - register: sshd_config + notify: sshd_restart -- name: Restart sshd - become: true - ansible.builtin.systemd_service: - name: sshd - state: restarted - when: sshd_config.changed +- name: Restart sshd service if necessary + ansible.builtin.meta: flush_handlers |