Replace sshd restart task with handler
This commit is contained in:
parent
3cb2c49955
commit
5087ccd9b3
BIN
handlers/.main.yaml.swp
Normal file
BIN
handlers/.main.yaml.swp
Normal file
Binary file not shown.
5
handlers/main.yaml
Normal file
5
handlers/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Restart sshd
|
||||
ansible.builtin.service:
|
||||
name: sshd
|
||||
state: restarted
|
@ -13,13 +13,8 @@
|
||||
mode: '0644'
|
||||
become: true
|
||||
register: sshd_config_file
|
||||
|
||||
- name: Restart service
|
||||
ansible.builtin.systemd:
|
||||
name: sshd
|
||||
enabled: true
|
||||
state: restarted
|
||||
when: sshd_config_file.changed
|
||||
notify:
|
||||
- Restart sshd
|
||||
|
||||
- name: Write banner file
|
||||
ansible.builtin.template:
|
||||
|
Loading…
x
Reference in New Issue
Block a user