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'
|
mode: '0644'
|
||||||
become: true
|
become: true
|
||||||
register: sshd_config_file
|
register: sshd_config_file
|
||||||
|
notify:
|
||||||
- name: Restart service
|
- Restart sshd
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: sshd
|
|
||||||
enabled: true
|
|
||||||
state: restarted
|
|
||||||
when: sshd_config_file.changed
|
|
||||||
|
|
||||||
- name: Write banner file
|
- name: Write banner file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user