xoxys.network/templates/etc/hosts.j2
Robert Kaussow 8fe311094a
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
fix: simplify ipaddr mapping in hosts file
2024-08-21 20:54:49 +02:00

18 lines
719 B
Django/Jinja

#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
{% if network_ipv6_enabled %}
::1 localhost6 localhost6.localdomain6
{% endif %}
{% if network_hostname is defined and network_fqdn is defined %}
{{ network_interfaces.0.ipaddr | default(ansible_default_ipv4.address) }} {{ network_fqdn }} {{ network_hostname }}
{% if network_ipv6_enabled %}
{{ network_interfaces.0.ipv6addr | default(ansible_default_ipv6.address) }} {{ network_fqdn }} {{ network_hostname }}
{% endif %}
{% endif %}
{% if network_hosts_extra %}
{% for item in network_hosts_extra %}
{{ item.address }} {{ item.fqdn }} {{ item.hostname }}
{% endfor %}
{% endif %}