From 1e9cf3a1c822db76ec48bce08fe0c37afa23cb21 Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Mon, 23 May 2016 17:44:32 +0200 Subject: [PATCH] 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 --- elements/base/install.d/10-cloud-init | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/elements/base/install.d/10-cloud-init b/elements/base/install.d/10-cloud-init index 3eea9af9..c4f87951 100755 --- a/elements/base/install.d/10-cloud-init +++ b/elements/base/install.d/10-cloud-init @@ -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