37 lines
678 B
YAML
37 lines
678 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: /var/unbound/etc/root.hints
|
|
mode: '0444'
|
|
notify: Reload unbound
|
|
|
|
- name: Fetch the initial keys
|
|
command: unbound-anchor
|
|
|
|
- name: Deploy the configuration
|
|
template:
|
|
src: unbound.conf.j2
|
|
dest: /etc/unbound/unbound.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: Reload unbound
|
|
|
|
- name: Enable and start unbound
|
|
systemd:
|
|
name: unbound
|
|
enabled: true
|
|
state: started
|
|
|