feat: add handlers to restart SSH service after configuration changes
Some checks failed
Nix Format Check / check-format (push) Failing after 37s

This commit is contained in:
2025-03-11 14:35:29 +01:00
parent 0c15c77d01
commit fd6b5ee127

View File

@ -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