# {{ ansible_managed }} {% for host in groups['all'] %} ## BEGIN {{ hostvars[host]['ansible_facts']['fqdn'] }} {% for ip in hostvars[host]['dnsmasq_host_ips'] %} {% set hostnames = hostvars[host]['inventory_hostname'] + hostvars[host]['inventory_hostname_short'] + hostvars[host]['dnsmasq_host_aliases'] %} {{ ip }} {{ hostnames | select() | join(' ') }} {% endfor %} ## END {{ hostvars[item]['ansible_facts']['fqdn'] }} {% endfor %}