From 2e0e7d7b52cf06bbbac333bf31800f00a79c7019 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 7 Dec 2018 23:04:58 +0100 Subject: [PATCH] fix empty network_hosts_entries --- templates/etc/hosts.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/etc/hosts.j2 b/templates/etc/hosts.j2 index 990cbbb..365c69d 100644 --- a/templates/etc/hosts.j2 +++ b/templates/etc/hosts.j2 @@ -7,6 +7,8 @@ {% if network_hostname is defined and network_fqdn is defined and network_interfaces[network_defaultif].ipaddr is defined %} {{ network_interfaces[network_defaultif].ipaddr }} {{ network_fqdn }} {{ network_hostname }} {% endif %} +{% if network_hosts_entries %} {% for item in network_hosts_entries %} {{ item.address }} {{ item.fqdn }} {{ item.hostname }} {% endfor %} +{% endif %}