{% for iface in interfaces | defaultattr('mgmt_only') | rejectattr('mgmt_only') | selectattr('enabled') %} {% for address in iface.ip_addresses | selectattr("family.value", "==", 6) %} {# get the gateway for this subnet #} {% set subnet = address.address | ipaddr('subnet') %} {% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %} {% set gateway = prefix.custom_fields.gateway.address %} {# if we are gateway, send RAs on this interface #} {% if gateway is defined and gateway == address.address %} interface {{ iface.name }} { AdvSendAdvert on; prefix ::/64; RDNSS {{ dns6 | join(' ') }} { }; DNSSL {{ domain }} { }; }; {% endif %} {% endfor %} {% endfor %}