63ca114c95
- migrate dictionary `ipv6` into two simple lists - migrate dictionary `forward_zones` into a list
58 lines
1.3 KiB
Django/Jinja
58 lines
1.3 KiB
Django/Jinja
//
|
|
// {{ ansible_managed }}
|
|
//
|
|
|
|
// ACLs
|
|
masters "ns-master-{{ item.site_code }}" {
|
|
{{ item.dns.master }};
|
|
};
|
|
|
|
{% for zone in item.dns.forward_zones %}
|
|
{% if zone.master is defined %}
|
|
masters "ns-master-{{ zone.name }}" {
|
|
{{ zone.master }};
|
|
};
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
acl "intern-{{ item.site_code }}" {
|
|
{{ item.ipv4_network | ipaddr('net') | ipaddr('network/prefix') }};
|
|
{% for prefix in item.ipv6_ula %}
|
|
{{ prefix | ipaddr('net') | ipaddr('network/prefix') }};
|
|
{% endfor %}
|
|
};
|
|
|
|
// DNS forward zones for {{ item.site_code }}
|
|
{% for zone in item.dns.forward_zones %}
|
|
zone "{{ zone.name }}." {
|
|
type slave;
|
|
file "{{ zone.name }}.db";
|
|
{% if zone.master is defined %}
|
|
masters { ns-master-{{ zone.name }}; };
|
|
{% else %}
|
|
masters { ns-master-{{ item.site_code }}; };
|
|
{% endif %}
|
|
};
|
|
{% if not loop.last %}
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
// DNS reverse zones for {{ item.site_code }}
|
|
zone "{{ item.ipv4_network | ipaddr('net') | ipaddr('revdns') }}" {
|
|
type slave;
|
|
file "{{ item.ipv4_network | ipaddr('net') | ipaddr('revdns') }}";
|
|
masters { ns-master-{{ item.site_code }}; };
|
|
};
|
|
|
|
{% for prefix in item.ipv6_ula %}
|
|
zone "{{ prefix | ipaddr('net') | ipaddr('revdns') }}" {
|
|
type slave;
|
|
file "{{ prefix | ipaddr('net') | ipaddr('revdns') }}";
|
|
masters { ns-master-{{ item.site_code }}; };
|
|
};
|
|
{% if not loop.last %}
|
|
|
|
{% endif %}
|
|
{% endfor %}
|