diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2017-11-19 03:15:26 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2017-11-19 12:46:35 +0100 |
commit | 3387c2fdcbe74be6767c5abce5beb9e7df2d3f5b (patch) | |
tree | 6263912c4754a73d13670605d9168267fa19d007 /roles/space_server/templates/avahi | |
parent | 3b795796bd03488a385f3ad42b10b8c0d61282c1 (diff) | |
download | labitat-ansible-3387c2fdcbe74be6767c5abce5beb9e7df2d3f5b.tar.gz labitat-ansible-3387c2fdcbe74be6767c5abce5beb9e7df2d3f5b.tar.xz labitat-ansible-3387c2fdcbe74be6767c5abce5beb9e7df2d3f5b.zip |
space_server: generate DNS, mDNS and dhcp entries
..from the same variables
Diffstat (limited to 'roles/space_server/templates/avahi')
-rw-r--r-- | roles/space_server/templates/avahi/hosts.j2 | 14 |
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 %} |