Turn off strict_id mode for Ec2 datasource

Recent changes in the default configuration of cloud-init in Ubuntu
cause warnings when the Ec2 datasource is used on non-Amazon clouds,
see https://bugs.launchpad.net/cloud-init/+bug/1660385

We explicitly select the previous behavior when an Ec2 datasource is
desired.

Change-Id: Iebad8f6c0017fe08013dd5fe667c6132158b71cd
Closes-bug: 1683038
This commit is contained in:
Simon Leinen 2017-04-15 19:01:42 +02:00
parent 7a962e9d1c
commit 0ff40cf63c

View File

@ -24,6 +24,19 @@ EOF
else
cat > /etc/cloud/cloud.cfg.d/91-dib-cloud-init-datasources.cfg <<EOF
datasource_list: [ $DIB_CLOUD_INIT_DATASOURCES, None ]
EOF
fi
# Newer cloud-init versions complain by default when they should
# use the Ec2 datasource on a non-AWS cloud. If the Ec2
# datasource is desired, we need to tell cloud-init that we really
# want this. Otherwise there will be ugly warnings or worse.
#
if [[ $DIB_CLOUD_INIT_DATASOURCES =~ Ec2 ]]; then
cat > /etc/cloud/cloud.cfg.d/92-ec2-datasource.cfg <<EOF
#cloud-config
datasource:
Ec2:
strict_id: false
EOF
fi
fi