Skip to content
Snippets Groups Projects
Commit 1e74732f authored by Thomas Schneider's avatar Thomas Schneider
Browse files

unbound: Add support for authoritative zones

parent cb0e59f7
No related branches found
No related tags found
No related merge requests found
Pipeline #2733 passed
---
unbound_auth_zones: []
...@@ -8,6 +8,23 @@ ...@@ -8,6 +8,23 @@
- packages - packages
- unbound - unbound
- name: Create directory for zones
file:
path: /etc/unbound/zones
state: directory
tags:
- unbound
- name: Install authoritative zone files
copy:
src: "{{ item.file }}"
dest: "/etc/unbound/zones/{{ item.zone }}zone"
loop: "{{ unbound_auth_zones }}"
notify:
- restart unbound
tags:
- unbound
- name: Install unbound config - name: Install unbound config
template: template:
src: unbound.conf.j2 src: unbound.conf.j2
......
...@@ -2,14 +2,29 @@ server: ...@@ -2,14 +2,29 @@ server:
interface: 0.0.0.0 interface: 0.0.0.0
interface: :: interface: ::
prefetch: yes prefetch: yes
{% for i in unbound_allowed_hosts %} {% for i in unbound_allowed_hosts -%}
access-control: {{ i }} allow access-control: {{ i }} allow
{% endfor -%}
{% for i in unbound_auth_zones if i.local_zone_transparent|default(False) -%}
local-zone: {{ i.zone }} transparent
{% endfor %} {% endfor %}
remote-control:
control-enable: yes
{% if unbound_upstream_hosts is defined and unbound_upstream_hosts %} {% if unbound_upstream_hosts is defined and unbound_upstream_hosts %}
forward-zone: forward-zone:
name: "." name: "."
{% for i in unbound_upstream_hosts %} {% for i in unbound_upstream_hosts -%}
forward-addr: {{i}} forward-addr: {{i}}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% for i in unbound_auth_zones -%}
auth-zone:
name: {{ i.zone }}
zonefile: zones/{{ i.zone }}zone
{% if not loop.last %}
{% endif %}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment