ansible-role-bind/templates/named.conf.local.j2
Benjamen Meyer 8681f17bad Enhancement: Reverse DNS Zone Support
- Incomplete
- Creates the directory for the Reverse DNS Zones
- Fails to copy the files and apply the db-reverse.js template
- Not sure if DNSSEC is applicable on the reverse zone or not
2018-07-07 01:11:46 -04:00

52 lines
1.5 KiB
Django/Jinja

# {{ ansible_managed }}
{% for zone, value in bind_reverse_zones.iteritems() %}
{% if 'state' not in value or value.state|lower not in ['disabled', 'absent'] %}
zone "{{ zone }}" IN {
type master;
{% if 'dnssec' in value and value.dnssec %}
file "/etc/bind/zones/{{ zone }}/db.signed";
{% else %}
file "/etc/bind/zones/{{ zone }}/db";
{% endif %}
{% if 'allow_transfer' in value and value.dnssec %}
allow-transfer {
{% for ip in value.allow_transfer %}
{{ ip }};
{% endfor %}
};
{% endif %}
{% 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 %}
};
{% endif %}
{% endfor %}
{% for zone, value in bind_zones.iteritems() %}
{% if 'state' not in value or value.state|lower not in ['disabled', 'absent'] %}
zone "{{ zone }}" IN {
type master;
{% if 'dnssec' in value and value.dnssec %}
file "/etc/bind/zones/{{ zone }}/db.signed";
{% else %}
file "/etc/bind/zones/{{ zone }}/db";
{% endif %}
{% if 'allow_transfer' in value and value.dnssec %}
allow-transfer {
{% for ip in value.allow_transfer %}
{{ ip }};
{% endfor %}
};
{% endif %}
{% 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 %}
};
{% endif %}
{% endfor %}