role_dnsmasq/templates/auto.conf.j2

13 lines
453 B
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# {{ 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 %}