From 03b437db0eb93399d17ca5be1d6927c9a38c0451 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 12 Jun 2013 13:28:27 +1200 Subject: [PATCH] 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 --- elements/cloud-init-nocloud/README.md | 3 +++ .../install.d/05-inject-local-source-data | 8 ++++++++ elements/ubuntu/first-boot.d/01-ssh | 4 ---- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 elements/cloud-init-nocloud/install.d/05-inject-local-source-data delete mode 100755 elements/ubuntu/first-boot.d/01-ssh diff --git a/elements/cloud-init-nocloud/README.md b/elements/cloud-init-nocloud/README.md index 02108557e..0223c4eb2 100644 --- a/elements/cloud-init-nocloud/README.md +++ b/elements/cloud-init-nocloud/README.md @@ -1,3 +1,6 @@ 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 such as the EC2 metadata service. + +Empty on-disk sources are created in /var/lib/cloud/seed/nocloud/. + diff --git a/elements/cloud-init-nocloud/install.d/05-inject-local-source-data b/elements/cloud-init-nocloud/install.d/05-inject-local-source-data new file mode 100755 index 000000000..470b1da86 --- /dev/null +++ b/elements/cloud-init-nocloud/install.d/05-inject-local-source-data @@ -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 diff --git a/elements/ubuntu/first-boot.d/01-ssh b/elements/ubuntu/first-boot.d/01-ssh deleted file mode 100755 index 08f52c74b..000000000 --- a/elements/ubuntu/first-boot.d/01-ssh +++ /dev/null @@ -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