bind: add explicity slaves

This commit is contained in:
Astro 2017-01-23 22:23:56 +01:00
parent 9f2b51db1e
commit 7cbd9c1089
2 changed files with 24 additions and 0 deletions

View File

@ -4,6 +4,13 @@ bind:
public-ns:
- ns.c3d2.de
- spaceboyz.net
slaves:
# bind.wetu.c3d2.de
- 172.22.100.9
- fd23:42:c3d2::1
# dns.spaceboyz.net
- 172.22.24.4
- 2a01:4f8:a0:33d0::4
serial: 2017012300
reverse-zones-inet:

View File

@ -1,7 +1,23 @@
{% macro slaves() -%}
{%- if pillar['bind']['slaves'] -%}
allow-transfer {
{%- for addr in pillar['bind']['slaves'] -%}
{{ addr }};
{%- endfor -%}
};
also-notify {
{%- for addr in pillar['bind']['slaves'] -%}
{{ addr }};
{%- endfor -%}
};
{%- endif -%}
{%- endmacro %}
{%- set domain = pillar['bind']['root-domain'] %}
zone "{{ domain }}" IN {
type master;
file "/etc/bind/{{ domain }}.zone";
{{ slaves() }}
};
{%- for net, subnet4 in pillar['subnets-inet'].items() %}
@ -9,6 +25,7 @@ zone "{{ domain }}" IN {
zone "{{ domain }}" IN {
type master;
file "/etc/bind/{{ domain }}.zone";
{{ slaves() }}
};
{%- endfor %}