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.j214
1 files changed, 14 insertions, 0 deletions
diff --git a/roles/space_server/templates/avahi-hosts.j2 b/roles/space_server/templates/avahi-hosts.j2
new file mode 100644
index 0000000..f87ad4b
--- /dev/null
+++ b/roles/space_server/templates/avahi-hosts.j2
@@ -0,0 +1,14 @@
+{% for host in local_hosts %}
+{% if 'mdns' not in host or host.mdns %}
+{% for ip in host.ips | ipv4 %}
+{% if loop.index <= 1 %}
+{{ ip }} {{ host.name }}.local
+{% endif %}
+{% endfor %}
+{% for ip in host.ips | ipv6 %}
+{% if loop.index <= 1 %}
+{{ ip }} {{ host.name }}.local
+{% endif %}
+{% endfor %}
+{% endif %}
+{% endfor %}