ansible-playbooks/roles/unbound/handlers/main.yml
2025-11-02 21:18:15 +01:00

17 lines
508 B
YAML

---
- name: Check Unbound config syntax
ansible.builtin.command: unbound-checkconf "{{ unbound_config_path }}"
register: unbound_validation
changed_when: false
failed_when: unbound_validation.rc != 0
- name: Reload systemd and restart unbound
ansible.builtin.systemd:
name: unbound
state: restarted
daemon_reload: true
- name: Reload AppArmor profile
ansible.builtin.command: apparmor_parser -r {{ unbound_apparmor_profile_path }}
when: ansible_facts.apparmor.status == "enabled"