roles/named: Improve support for other zone types

Only *master* zones need zone files pre-populated, as the other types of
zones are populated by data named receives from queries and transfers.
Other types of zones require other options, however, to be usable. This
commit introduces minimal support for specifying *slave*, *forward*, and
*stub* zones.
jenkins-master
Dustin 2018-02-21 22:33:52 -06:00
parent 83817ca340
commit 3473694eb0
2 changed files with 22 additions and 2 deletions

View File

@ -40,7 +40,7 @@
owner: root
group: named
force: no
with_items: '{{ named_zones }}'
with_items: '{{ named_zones|selectattr("type", "eq", "master")|list }}'
notify: reload named
- name: ensure named is configured

View File

@ -2,8 +2,14 @@
{% for zone in named_zones %}
zone "{{ zone.zone }}" {
type {{ zone.type|d('master') }};
type {{ zone.type }};
{% if zone.type == 'forward' %}
{% if zone.forward|d %}
forward {{ zone.forward }};
{% endif %}
{% else %}
file "dynamic/{{ zone.zone }}.zone";
{% endif %}
{% if zone.allow_update|d %}
allow-update {
{% for auth in zone.allow_update %}
@ -18,5 +24,19 @@ zone "{{ zone.zone }}" {
{% endfor %}
};
{% endif %}
{% if zone.forwarders|d %}
forwarders {
{% for forwarder in zone.forwarders %}
{{ forwarder }};
{% endfor %}
};
{% endif %}
{% if zone.masters|d %}
masters {
{% for master in zone.masters %}
{{ master }};
{% endfor %}
};
{% endif %}
};
{% endfor %}