2017-06-01 14:07:11 +02:00
|
|
|
---
|
|
|
|
- name: Install Unbound package
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.apt:
|
2017-06-01 14:07:11 +02:00
|
|
|
name: unbound
|
|
|
|
state: present
|
|
|
|
when: ansible_distribution == "Debian"
|
|
|
|
tags:
|
|
|
|
- unbound
|
|
|
|
|
2018-01-11 12:41:40 +01:00
|
|
|
- name: Retrieve list of root DNS servers
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.get_url:
|
2018-01-11 12:41:40 +01:00
|
|
|
url: https://www.internic.net/domain/named.cache
|
|
|
|
dest: /etc/unbound/root.hints
|
|
|
|
force: yes
|
|
|
|
mode: "0644"
|
|
|
|
notify: reload unbound
|
|
|
|
tags:
|
|
|
|
- unbound
|
|
|
|
|
2017-06-01 14:07:11 +02:00
|
|
|
- name: Copy Unbound config
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2017-06-01 14:07:11 +02:00
|
|
|
src: unbound.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0644"
|
|
|
|
when: ansible_distribution == "Debian"
|
|
|
|
notify: reload unbound
|
|
|
|
tags:
|
|
|
|
- unbound
|
|
|
|
|
|
|
|
- name: Starting and enabling Unbound
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.service:
|
2017-06-01 14:07:11 +02:00
|
|
|
name: unbound
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
tags:
|
|
|
|
- unbound
|