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

63 lines
1.4 KiB
Text
Raw Normal View History

2017-10-02 23:34:53 +02:00
//
// {{ ansible_managed }}
//
// ACLs
2019-03-02 18:10:48 +01:00
masters "ns-master-{{ item.domain_code }}" {
{{ item.dns.master }};
2017-10-02 23:34:53 +02:00
};
2019-03-02 18:10:48 +01:00
{% if item.dns.forward_zones is defined %}
{% 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 %}
2019-03-02 18:10:48 +01:00
{% endif %}
2017-10-02 23:34:53 +02:00
2019-03-02 18:10:48 +01:00
acl "intern-{{ item.domain_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 %}
};
2019-03-02 18:10:48 +01:00
{% if item.dns.forward_zones is defined %}
// DNS forward zones for {{ item.domain_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 %}
2019-03-02 18:10:48 +01:00
masters { ns-master-{{ item.domain_code }}; };
2017-10-02 23:34:53 +02:00
{% endif %}
};
{% if not loop.last %}
{% endif %}
{% endfor %}
2019-03-02 18:10:48 +01:00
{% endif %}
2017-10-02 23:34:53 +02:00
2019-03-02 18:10:48 +01:00
// DNS reverse zones for {{ item.domain_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') }}";
2019-03-02 18:10:48 +01:00
masters { ns-master-{{ item.domain_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') }}";
2019-03-02 18:10:48 +01:00
masters { ns-master-{{ item.domain_code }}; };
2017-10-02 23:34:53 +02:00
};
{% if not loop.last %}
{% endif %}
{% endfor %}