address: '{{ domain_name_eth0 }}' addresses: {% if 'dns_client_address' in general.network %} - dns_address: '{{ general.network.dns_client_address }}' dns_ip: '{{ ip_dns }}' {% elif 'unbound_forward_address' in general.dns_resolver.forward_zones %} {% for authority in general.dns_resolver.forward_zones.unbound_forward_address %} - dns_address: {{ authority }} dns_ip: {{ authority.unbound_allowed_client }} {% endfor %} {% elif 'nsd_zones' in general.dns_zone %} {%for zone in general.dns_zone.nsd_zones %} {% set suffix = zone|normalize_family %} {% set hostnames = nsd["nsd_zone_" + suffix]["hostname_" + suffix]["hostname_" + suffix] %} {% for hostname in hostnames %} - dns_address: {{ hostname }}.{{ zone }} dns_ip: {{ hostname["ip_" + suffix] }} {% endfor %} {% endfor %} {% endif %} {% endif %} {% if dns_is_only_local %} dns_is_only_local: true {% else %} dns_is_only_local: false {% endif %}