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
parent
83817ca340
commit
3473694eb0
|
@ -40,7 +40,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: named
|
group: named
|
||||||
force: no
|
force: no
|
||||||
with_items: '{{ named_zones }}'
|
with_items: '{{ named_zones|selectattr("type", "eq", "master")|list }}'
|
||||||
notify: reload named
|
notify: reload named
|
||||||
|
|
||||||
- name: ensure named is configured
|
- name: ensure named is configured
|
||||||
|
|
|
@ -2,8 +2,14 @@
|
||||||
{% for zone in named_zones %}
|
{% for zone in named_zones %}
|
||||||
|
|
||||||
zone "{{ zone.zone }}" {
|
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";
|
file "dynamic/{{ zone.zone }}.zone";
|
||||||
|
{% endif %}
|
||||||
{% if zone.allow_update|d %}
|
{% if zone.allow_update|d %}
|
||||||
allow-update {
|
allow-update {
|
||||||
{% for auth in zone.allow_update %}
|
{% for auth in zone.allow_update %}
|
||||||
|
@ -18,5 +24,19 @@ zone "{{ zone.zone }}" {
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
{% endif %}
|
{% 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 %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue