-
Notifications
You must be signed in to change notification settings - Fork 874
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Alpine and Mariner /etc/hosts templates
Revert the changes I introduced with #1084, these had the side-effect of causing "hostname" problems. Fixes #4771. Also remove the "::1 {{fqdn}} {{hostname}}" entry as this this being results in strange behaviour with both Busybox "hostname -i" (returns "127.0.0.1", or "127.0.0.1 A.B.C.D" if an additional non-loopback IP entry in /etc/hosts) and Coreutils "hostname -i" (returns "::1" in both situations), commands whereas if the "::1" entry is removed then both Busybox and Coreutils behave the the same fashion returning "127.0.0.1" or "127.0.0.1 A.B.C.D" as appropriate. Also correct hosts.mariner.tmpli file it was not valid (every line was prefixed with "+").
- Loading branch information
1 parent
034a5cd
commit 34e8cd2
Showing
2 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
+## template:jinja | ||
+{# | ||
+This file /etc/cloud/templates/hosts.mariner.tmpl is only utilized | ||
+if enabled in cloud-config. Specifically, in order to enable it | ||
+you need to add the following to config: | ||
+ manage_etc_hosts: True | ||
+-#} | ||
+# Your system has configured 'manage_etc_hosts' as True. | ||
+# As a result, if you wish for changes to this file to persist | ||
+# then you will need to either | ||
+# a.) make changes to the master file in /etc/cloud/templates/hosts.mariner.tmpl | ||
+# b.) change or remove the value of 'manage_etc_hosts' in | ||
+# /etc/cloud/cloud.cfg or cloud-config from user-data | ||
+# | ||
+# The following lines are desirable for IPv4 capable hosts | ||
+127.0.0.1 {{fqdn}} {{hostname}} | ||
+127.0.0.1 localhost.localdomain localhost | ||
+127.0.0.1 localhost4.localdomain4 localhost4 | ||
+ | ||
+# The following lines are desirable for IPv6 capable hosts | ||
+::1 {{fqdn}} {{hostname}} | ||
+::1 localhost6.localdomain6 localhost6 | ||
## template:jinja | ||
{# | ||
This file /etc/cloud/templates/hosts.mariner.tmpl is only utilized | ||
if enabled in cloud-config. Specifically, in order to enable it | ||
you need to add the following to config: | ||
manage_etc_hosts: True | ||
-#} | ||
# Your system has configured 'manage_etc_hosts' as True. | ||
# As a result, if you wish for changes to this file to persist | ||
# then you will need to either | ||
# a.) make changes to the master file in /etc/cloud/templates/hosts.mariner.tmpl | ||
# b.) change or remove the value of 'manage_etc_hosts' in | ||
# /etc/cloud/cloud.cfg or cloud-config from user-data | ||
# | ||
# The following lines are desirable for IPv4 capable hosts | ||
127.0.0.1 {{fqdn}} {{hostname}} | ||
127.0.0.1 localhost.localdomain localhost | ||
127.0.0.1 localhost4.localdomain4 localhost4 | ||
|
||
# The following lines are desirable for IPv6 capable hosts | ||
::1 {{fqdn}} {{hostname}} | ||
::1 localhost6.localdomain6 localhost6 |