2020-04-13 16:35:09 +02:00
|
|
|
---
|
|
|
|
|
2020-04-18 16:52:13 +02:00
|
|
|
# This is used to let unbound bind to the right IP addresses.
|
2020-04-18 17:36:25 +02:00
|
|
|
- name: set dns_host_suffix (main)
|
|
|
|
set_fact:
|
2020-04-18 16:52:13 +02:00
|
|
|
dns_host_suffix: "{{ dns_host_suffix_main }}"
|
|
|
|
when: "'rdns_main' in group_names"
|
|
|
|
|
2020-04-18 17:36:25 +02:00
|
|
|
- name: set dns_host_suffix (backup)
|
|
|
|
set_fact:
|
2020-04-18 16:52:13 +02:00
|
|
|
dns_host_suffix: "{{ dns_host_suffix_backup }}"
|
|
|
|
when: "'rdns_backup' in group_names"
|
|
|
|
|
|
|
|
|
2020-04-13 16:35:09 +02:00
|
|
|
- name: install unbound
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name: unbound
|
|
|
|
state: present
|
2020-04-28 20:21:47 +02:00
|
|
|
register: unbound_install
|
|
|
|
|
|
|
|
- name: add unbound-control configuration
|
|
|
|
template:
|
|
|
|
src: unbound-control.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf.d/unbound-control.conf
|
|
|
|
mode: 0644
|
2020-05-02 16:43:44 +02:00
|
|
|
notify: restart unbound
|
2020-04-13 16:35:09 +02:00
|
|
|
|
|
|
|
- name: setup main unbound config file
|
|
|
|
template:
|
|
|
|
src: unbound.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf
|
|
|
|
mode: 0644
|
2020-05-02 16:43:44 +02:00
|
|
|
notify: restart unbound
|
2020-04-13 16:35:09 +02:00
|
|
|
|
|
|
|
- name: setup recursive DNS server config
|
|
|
|
template:
|
|
|
|
src: recursive.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf.d/recursive.conf
|
|
|
|
mode: 0644
|
2020-05-02 16:43:44 +02:00
|
|
|
notify: restart unbound
|