aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/templates/avahi-hosts.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/space_server/templates/avahi-hosts.j2')
-rw-r--r--roles/space_server/templates/avahi-hosts.j220
1 files changed, 12 insertions, 8 deletions
diff --git a/roles/space_server/templates/avahi-hosts.j2 b/roles/space_server/templates/avahi-hosts.j2
index f87ad4b..1e371e6 100644
--- a/roles/space_server/templates/avahi-hosts.j2
+++ b/roles/space_server/templates/avahi-hosts.j2
@@ -1,14 +1,18 @@
{% for host in local_hosts %}
{% if 'mdns' not in host or host.mdns %}
-{% for ip in host.ips | ipv4 %}
-{% if loop.index <= 1 %}
+{% if 'ipv4' in host %}
+{% for ip in host.ipv4 %}
+{% if loop.index <= 1 %}
{{ ip }} {{ host.name }}.local
-{% endif %}
-{% endfor %}
-{% for ip in host.ips | ipv6 %}
-{% if loop.index <= 1 %}
+{% endif %}
+{% endfor %}
+{% endif %}
+{% if 'ipv6' in host %}
+{% for ip in host.ipv6 %}
+{% if loop.index <= 1 %}
{{ ip }} {{ host.name }}.local
-{% endif %}
-{% endfor %}
+{% endif %}
+{% endfor %}
+{% endif %}
{% endif %}
{% endfor %}