浏览代码

Add localhost.localdomain FQDN for 127.0.0.1 for hosts file

Emmanuel Bouthenot 11 年之前
父节点
当前提交
cf40eca524
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      roles/common/templates/hosts.j2

+ 5 - 5
roles/common/templates/hosts.j2

@@ -3,12 +3,12 @@
 {{ prolog() }}
 {% endif -%}
 
-127.0.0.1       localhost
-{% if ansible_default_ipv4 is defined %}
-{{ ansible_default_ipv4.address }}  {{ ansible_fqdn }}  {{ ansible_hostname }}
+127.0.0.1 localhost.localdomain localhost
+{% if ansible_default_ipv4.address is defined %}
+{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}
 {% endif %}
-{% if ansible_default_ipv6 is defined %}
-{{ ansible_default_ipv6.address }}  {{ ansible_fqdn }}  {{ ansible_hostname }}
+{% if ansible_default_ipv6.address is defined %}
+{{ ansible_default_ipv6.address }} {{ ansible_fqdn }} {{ ansible_hostname }}
 {% endif %}
 
 # The following lines are desirable for IPv6 capable hosts