Files
homelab/ansible/playbooks/configure_unbound.yml

38 lines
968 B
YAML

---
- name: Master playbook to install and configure unbound
hosts: unbound_servers
become: true
tasks:
- name: Permit traffic in default zone for dns service
ansible.posix.firewalld:
service: dns
permanent: true
immediate: true
state: enabled
- name: Create the directory
ansible.builtin.file:
path: /etc/systemd/resolved.conf.d
state: directory
mode: '0755'
owner: root
group: root
- name: Put `unbound.conf` in the correct place
ansible.builtin.copy:
src: ../roles/common/files/unbound.conf
dest: /etc/systemd/resolved.conf.d/unbound.conf
mode: '0644'
owner: root
group: root
- name: Restart service systemd-resolved
ansible.builtin.service:
name: systemd-resolved
state: restarted
- name: Install unbound via role
ansible.builtin.import_role:
name: Anthony25.unbound