ansible/roles/unbound/tasks/main.yml

32 lines
643 B
YAML

---
- name: Install unbound
apt:
name: unbound
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Download the root file
get_url:
url: https://www.internic.net/domain/named.root
dest: /etc/unbound/root.hints
mode: "0644"
notify: update root trust anchor
- name: Deploy the configuration
template:
src: unbound.conf.j2
dest: /etc/unbound/unbound.conf
owner: root
group: root
mode: 0644
notify: systemctl restart unbound.service
- name: Enable and start unbound
systemd:
name: unbound
enabled: true
state: started