ansible-role-bind/templates/named.conf.local.j2

29 lines
773 B
Text
Raw Normal View History

2017-10-08 12:55:01 +00:00
# {{ ansible_managed }}
{% for zone, value in bind_zones.iteritems() %}
2018-03-31 15:50:50 +00:00
{% if 'state' not in value or value.state|lower not in ['disabled', 'absent'] %}
2017-10-08 12:55:01 +00:00
zone "{{ zone }}" IN {
2018-03-17 17:26:08 +00:00
type master;
2017-10-08 12:55:01 +00:00
{% if 'dnssec' in value and value.dnssec %}
2018-03-31 15:50:50 +00:00
file "/etc/bind/zones/{{ zone }}/db.signed";
2017-10-08 12:55:01 +00:00
{% else %}
2018-03-31 15:50:50 +00:00
file "/etc/bind/zones/{{ zone }}/db";
2017-10-08 12:55:01 +00:00
{% endif %}
2018-03-17 17:26:08 +00:00
allow-transfer {
{% if 'allow_transfer' in value and value.dnssec %}
{% for ip in value.allow_transfer %}
{{ ip }};
{% endfor %}
{% else %}
"none";
{% endif %}
};
2018-03-17 19:39:53 +00:00
{% if 'options' in value %}
{% for option, opt_value in value.options.iteritems() %}
{{ option }} {% if opt_value == True %}yes{% elif opt_value == False %}no{% else %}{{ opt_value }}{% endif %};
{% endfor %}
{% endif %}
2017-10-08 12:55:01 +00:00
};
2018-03-31 15:50:50 +00:00
{% endif %}
2017-10-08 12:55:01 +00:00
{% endfor %}