[FIX] Gérer l'absence d'ipv4 ou ipv6

This commit is contained in:
pulsar89.5 2023-06-05 15:19:23 +02:00
parent 712b394e8d
commit 8b53aed46a

View File

@ -1,8 +1,9 @@
# {{ ansible_managed }}
{% for ip in dnsmasq_host_ipv4 %}
{{ ip }} {{ dnsmasq_client_hostname }} {{ dnsmasq_host_aliases | join(' ') }}
{% endfor %}
{% for ip in dnsmasq_host_ipv6 %}
{% set ips = dnsmasq_host_ipv4 + dnsmasq_host_ipv6 %}
{% for ip in ips %}
{% if ip | length > 0 %}
{{ ip }} {{ dnsmasq_client_hostname }} {{ dnsmasq_host_aliases | join(' ') }}
{% endif %}
{% endfor %}