Consolidate hosts template
For alpine, debian, ceph and proxmox roles. Add the union of IPv6 LL host entries across all distros to make sure nothing croaks.
This commit is contained in:
parent
35427f1fbc
commit
e754db5fbd
4 changed files with 15 additions and 24 deletions
15
templates/hosts.j2
Normal file
15
templates/hosts.j2
Normal file
|
@ -0,0 +1,15 @@
|
|||
127.0.0.1 localhost
|
||||
::1 localhost ip6-localhost ip6-loopback
|
||||
fe00::0 ip6-localnet
|
||||
ff00::0 ip6-mcastprefix
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
ff02::3 ip6-allhosts
|
||||
|
||||
{# Static entries for all nodes in the cluster or just this one if there is no cluster. #}
|
||||
{% for address in nodes | default([hostvars[inventory_hostname]])
|
||||
| map(attribute='interfaces') | flatten
|
||||
| map(attribute='ip_addresses') | flatten
|
||||
| selectattr('dns_name') %}
|
||||
{{ address.address | ipaddr('address') }} {{ address.dns_name }} {{ address.dns_name | split('.') | first }}
|
||||
{% endfor %}
|
Loading…
Add table
Add a link
Reference in a new issue