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 {
|
2018-07-08 21:02:11 +00:00
|
|
|
{% if 'allow_transfer' in value and value.dnssec %}
|
2017-10-14 23:11:49 +00:00
|
|
|
{% for ip in value.allow_transfer %}
|
|
|
|
{{ ip }};
|
|
|
|
{% endfor %}
|
2018-07-08 21:02:11 +00:00
|
|
|
{% else %}
|
|
|
|
"none";
|
2017-10-14 23:11:49 +00:00
|
|
|
{% endif %}
|
2018-07-08 21:02:11 +00:00
|
|
|
};
|
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 %}
|