diff --git a/elements/debian/install.d/10-cloud-opinions b/elements/debian/install.d/10-cloud-opinions index fc160f21c..8fd581250 100755 --- a/elements/debian/install.d/10-cloud-opinions +++ b/elements/debian/install.d/10-cloud-opinions @@ -37,5 +37,10 @@ if [ "$DIB_DEBIAN_ALT_INIT_PACKAGE" != "sysvinit" ]; then /etc/apt/preferences.d/sysvinit > /etc/apt/preferences.d/sysvinit fi -# specify a hostname so that cloud-init does not default to (None) -echo 'hostname: debian' > /etc/cloud/cloud.cfg.d/01_hostname.cfg +# Since Jessie, when either 'hostname' or 'fqdn' are in a config file, it +# considers them as authoritative and would only use cloud meta data as a +# fallback. +if [ "$DIB_RELEASE" = 'wheezy' ]; then + # specify a hostname so that cloud-init does not default to (None) + echo 'hostname: debian' > /etc/cloud/cloud.cfg.d/01_hostname.cfg +fi