aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/templates/avahi-hosts.j2
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2018-09-26 13:16:11 +0200
committerEmil Renner Berthing <esmil@labitat.dk>2018-11-10 22:30:23 +0100
commit9454fdbff511e965e4fd9eb187b7fe432dcd437e (patch)
tree616a430b46a4796dfbcbc53662a1f70af59720b5 /roles/space_server/templates/avahi-hosts.j2
parentf203f1ccf538955dbd81e9a81b4cb9da520a9afa (diff)
downloadlabitat-ansible-9454fdbff511e965e4fd9eb187b7fe432dcd437e.tar.gz
labitat-ansible-9454fdbff511e965e4fd9eb187b7fe432dcd437e.tar.xz
labitat-ansible-9454fdbff511e965e4fd9eb187b7fe432dcd437e.zip
space_server: drop uneccessary subdirs
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 %}