Remove deprecated overriding of cloud-init defaults
The "set to localhost by default" behavior for manage_etc_hosts has been deprecated for more than a year now by change Ia8582883f737548e2911d3f36a1943e5b236281b. Setting that value to "localhost" is still possible, but it won't be the default anymore. If the previous behavior of assigning the hostname and FQDN to 127.0.0.1 is still desired in some environments, it can be achieved by setting the DIB_CLOUD_INIT_ETC_HOSTS environment variable, as the deprecation warning message suggested. Change-Id: I5a19d46e2f305769a0c89c9d25d2e6be02910221
This commit is contained in:
parent
f0b57d5efd
commit
1e9cf3a1c8
@ -10,13 +10,7 @@ set -o pipefail
|
||||
# cloud-init May not actually be installed
|
||||
mkdir -p /etc/cloud/cloud.cfg.d
|
||||
|
||||
if [ ! -v DIB_CLOUD_INIT_ETC_HOSTS ]; then
|
||||
echo "WARNING: In the future the default setting for manage_etc_hosts will not be overridden by this element."
|
||||
echo "WARNING: Set DIB_CLOUD_INIT_ETC_HOSTS to 'localhost' to preserve current behavior."
|
||||
fi
|
||||
|
||||
DIB_CLOUD_INIT_ETC_HOSTS=${DIB_CLOUD_INIT_ETC_HOSTS-localhost}
|
||||
if [ -n "$DIB_CLOUD_INIT_ETC_HOSTS" ]; then
|
||||
if [ -n "${DIB_CLOUD_INIT_ETC_HOSTS:-}" ]; then
|
||||
dd of=/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg << EOF
|
||||
manage_etc_hosts: $DIB_CLOUD_INIT_ETC_HOSTS
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user