Fix cloud-init-nocloud to actually work.

Bug 1124593 reported that ssh host keys were not being created, and the
lack of seed metadata files was the cause. Add those files and remove
the workaround.

Change-Id: I6fb55be7f8c7efd1f75aeba9123f495e312ff695
This commit is contained in:
Robert Collins 2013-06-12 13:28:27 +12:00
parent 1fa27e745d
commit 03b437db0e
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,6 @@
Configures cloud-init to only use on-disk metadata/userdata sources. This Configures cloud-init to only use on-disk metadata/userdata sources. This
will avoid a boot delay of 2 minutes while polling for cloud data sources will avoid a boot delay of 2 minutes while polling for cloud data sources
such as the EC2 metadata service. such as the EC2 metadata service.
Empty on-disk sources are created in /var/lib/cloud/seed/nocloud/.

View File

@ -0,0 +1,8 @@
#!/bin/bash
# without these files, cloud-init will not perform stock operations such as
# generating sshd hostkeys.
mkdir -p /var/lib/cloud/seed/nocloud
touch /var/lib/cloud/seed/nocloud/user-data
touch /var/lib/cloud/seed/nocloud/meta-data

View File

@ -1,4 +0,0 @@
#!/bin/bash
# NOTE: this file should be removed once cloud-init is properly generating hostkeys
# https://bugs.launchpad.net/diskimage-builder/+bug/1124593
dpkg-reconfigure openssh-server