You've already forked role_etc_hosts
[INFO] Créer le role
This commit is contained in:
28
templates/hosts.j2
Normal file
28
templates/hosts.j2
Normal file
@@ -0,0 +1,28 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{%- if inventory_hostname != inventory_hostname_short %}
|
||||
{%- set host = inventory_hostname ~ ' ' ~ inventory_hostname_short %}
|
||||
{%- else %}
|
||||
{% set host = inventory_hostname_short %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if etc_hosts_local | length > 0 %}
|
||||
{% set line = host ~ ' ' ~ (etc_hosts_local | join(' ')) %}
|
||||
{%- else %}
|
||||
{% set line = host %}
|
||||
{%- endif +%}
|
||||
|
||||
127.0.0.1 {{ line }} localhost
|
||||
|
||||
# The following lines are desirable for IPv6 capable hosts
|
||||
::1 {{ line }} 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
|
||||
|
||||
{% if etc_hosts_specifics | length > 0 %}
|
||||
# The following lines are specified by instance configuration
|
||||
{{ etc_hosts_specifics | join('\n') }}
|
||||
{% endif %}
|
Reference in New Issue
Block a user