feat: add handlers to restart SSH service after configuration changes
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
This commit is contained in:
@ -12,10 +12,24 @@
|
||||
group: root
|
||||
mode: '0644'
|
||||
validate: '/usr/sbin/sshd -t -f %s'
|
||||
register: ssh_config
|
||||
notify: Restart SSH service
|
||||
|
||||
- name: Ensure SSH service is enabled and running
|
||||
ansible.builtin.service:
|
||||
name: ssh
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
# Handlers
|
||||
- name: Handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- name: Handlers block
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
- name: Restart SSH service
|
||||
ansible.builtin.service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
listen: Restart SSH service
|
||||
|
Reference in New Issue
Block a user