ansible/roles/unbound/tasks/main.yml

35 lines
737 B
YAML
Raw Normal View History

2020-04-13 16:35:09 +02:00
---
# This is used to let unbound bind to the right IP addresses.
- set_fact:
dns_host_suffix: "{{ dns_host_suffix_main }}"
when: "'rdns_main' in group_names"
- set_fact:
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
- name: setup main unbound config file
template:
src: unbound.conf.j2
dest: /etc/unbound/unbound.conf
mode: 0644
- name: setup recursive DNS server config
template:
src: recursive.conf.j2
dest: /etc/unbound/unbound.conf.d/recursive.conf
mode: 0644
- name: restart unbound after editing config
systemd:
state: restarted
name: unbound