Files
ansible-k8s-pi-cluster/templates/etchosts.j2

16 lines
471 B
Django/Jinja

# {{ ansible_managed }}
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
# The following lines are desirable for IPv6 capable hosts.
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# Network nodes as generated through Ansible.
{% for host in play_hosts %}
{% if 'ansible_eth0' in hostvars[host] %}
{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }} {{ host }}
{% endif %}
{% endfor %}