From 8b53aed46a162fc36d6704f799e3839cdcd8467a Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Mon, 5 Jun 2023 15:19:23 +0200 Subject: [PATCH] =?UTF-8?q?[FIX]=20G=C3=A9rer=20l'absence=20d'ipv4=20ou=20?= =?UTF-8?q?ipv6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/host.conf.j2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/host.conf.j2 b/templates/host.conf.j2 index 6dec476..7a681ef 100644 --- a/templates/host.conf.j2 +++ b/templates/host.conf.j2 @@ -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 %}