; zonefile for services.{{item.key}}. $TTL 86400 @ IN SOA {{bind_zonemaster.server}}. {{bind_zonemaster.email}}. ( {{ansible_date_time.epoch}} ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL {% set i = [1] %} {% for host in groups['gateways'] %} {% if 'is_external_nameserver' in hostvars[host] and hostvars[host].is_external_nameserver %} @ IN NS ns{{i[0]}}.{{item.key}}. {% if i.append(i.pop() + 1) %}{% endif %} {% endif %} {% endfor %} {% if bind.ffms_for_groups is defined and bind.ffms_for_groups.0 is defined %} {% for group in bind.ffms_for_groups %} {% if "static_hosts" in hostvars[groups[group][0]] %} {% for host in hostvars[groups[group][0]].static_hosts %} {{host.name}} IN A {{host.v4_address}} {% endfor %} {% endif %} {% endfor %} {% endif %}