ansible-ffibk/roles/service-bind-slave/templates/named.conf.mesh.j2

59 lines
1.3 KiB
Text
Raw Normal View History

2017-10-02 23:34:53 +02:00
//
// {{ ansible_managed }}
//
// ACLs
masters "ns-master-{{ item.site_code }}" {
{{ item.dns.master }};
2017-10-02 23:34:53 +02:00
};
{% for zone in item.dns.forward_zones %}
{% if zone.master is defined %}
masters "ns-master-{{ zone.name }}" {
{{ zone.master }};
2017-10-02 23:34:53 +02:00
};
{% endif %}
{% endfor %}
acl "intern-{{ item.site_code }}" {
{{ item.ipv4_network | ipaddr('net') | ipaddr('network/prefix') }};
{% for prefix in item.ipv6_ula %}
2017-10-02 23:34:53 +02:00
{{ prefix | ipaddr('net') | ipaddr('network/prefix') }};
{% endfor %}
};
// DNS forward zones for {{ item.site_code }}
{% for zone in item.dns.forward_zones %}
zone "{{ zone.name }}." {
2017-10-02 23:34:53 +02:00
type slave;
file "{{ zone.name }}.db";
{% if zone.master is defined %}
masters { ns-master-{{ zone.name }}; };
2017-10-02 23:34:53 +02:00
{% else %}
masters { ns-master-{{ item.site_code }}; };
2017-10-02 23:34:53 +02:00
{% endif %}
};
{% if not loop.last %}
{% endif %}
{% endfor %}
// DNS reverse zones for {{ item.site_code }}
zone "{{ item.ipv4_network | ipaddr('net') | ipaddr('revdns') }}" {
2017-10-02 23:34:53 +02:00
type slave;
file "{{ item.ipv4_network | ipaddr('net') | ipaddr('revdns') }}";
masters { ns-master-{{ item.site_code }}; };
2017-10-02 23:34:53 +02:00
};
{% for prefix in item.ipv6_ula %}
2017-10-02 23:34:53 +02:00
zone "{{ prefix | ipaddr('net') | ipaddr('revdns') }}" {
type slave;
file "{{ prefix | ipaddr('net') | ipaddr('revdns') }}";
masters { ns-master-{{ item.site_code }}; };
2017-10-02 23:34:53 +02:00
};
{% if not loop.last %}
{% endif %}
{% endfor %}