infra/ansible/roles/general/templates/etc/hosts.j2
2025-05-30 13:24:38 -05:00

11 lines
462 B
Django/Jinja

127.0.0.1 localhost
{% if network.loopback_in_hosts | default(True) %}
127.0.1.1 {{ inventory_hostname }} {{ inventory_hostname | split(".") | first }}
{% else %}
{{ "%-15s" | format(ansible_default_ipv4.address) }} {{ inventory_hostname }} {{ inventory_hostname | split(".") | first }}
{% endif %}
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters