From 3387c2fdcbe74be6767c5abce5beb9e7df2d3f5b Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sun, 19 Nov 2017 03:15:26 +0100 Subject: space_server: generate DNS, mDNS and dhcp entries ..from the same variables --- roles/space_server/templates/avahi/hosts.j2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 roles/space_server/templates/avahi/hosts.j2 (limited to 'roles/space_server/templates/avahi') 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 %} -- cgit v1.2.1