ansible-infra/roles/unbound/tasks/main.yml
bitwhisker 57ae1456a0
Some checks failed
/ Ansible Lint (pull_request) Successful in 2m37s
/ build (pull_request) Failing after 2m40s
/ Ansible Lint (push) Successful in 2m21s
unbound(role): move resolvd vars to task
2026-05-26 10:43:56 +02:00

47 lines
1.3 KiB
YAML

- name: unbound role main
block:
- name: install unbound dns resolver
become: true
ansible.builtin.package:
name: unbound
- name: ensure correct directory permissions
become: true
ansible.builtin.file:
path: /etc/unbound
state: directory
mode: u=rwX,g=rX,o=rX
recurse: true
owner: unbound
group: unbound
- name: configure unbound dns resolver
become: true
notify: unbound.restarted
ansible.builtin.template:
src: unbound.conf.j2
dest: /etc/unbound/unbound.conf
owner: unbound
group: unbound
mode: u=rw,g=r,o=r
- name: ensure unbound is running and enabled
become: true
ansible.builtin.systemd:
name: unbound.service
state: started
enabled: true
- name: disable systemd-resolved
when: unbound_disable_systemd_networkd
ansible.builtin.include_role:
name: deploy_systemd_resolved_config
vars:
deploy_systemd_resolved_config__enable: false
deploy_systemd_resolved_config__dns:
- 127.0.0.1
- name: install and configure prometheus-exporter for unbound
ansible.builtin.import_tasks: prometheus-exporter.yml
when: unbound_install_prometheus_exporter