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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user