# {{ ansible_managed }} {% for host in groups[dnsmasq_ansible_group] %} {%- set ipv4 = hostvars[host]['ansible_host'] %} {%- set ipv6_suffix = hostvars[host]['ansible_host'] | split('.') | last %} {%- set ipv6 = (dnsmasq_ipv6_subnet | split('/') | first) + ipv6_suffix %} {%- set aliases = [host] + hostvars[host].get('dnsmasq_host_aliases', []) %} # {{ host }} {{ ipv4 }} {{ aliases | join(' ') }} {{ ipv6 }} {{ aliases | join(' ') }} {% endfor %}