From 15a1ad0b5bf84d1d7291cfc853bee092a8616685 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Sat, 19 Jan 2013 08:09:42 +0000 Subject: [PATCH] Enable 'ec2-user' in HEAT for quantal images. Employs some workarounds that can be removed when bugs reference in comments are fixed elsewhere. Change-Id: If423844f0dfabbddd4d0d7b8ad8fcf6d32693195 --- elements/heat-jeos/install.d/10-ec2-user | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 elements/heat-jeos/install.d/10-ec2-user diff --git a/elements/heat-jeos/install.d/10-ec2-user b/elements/heat-jeos/install.d/10-ec2-user new file mode 100755 index 000000000..19b736c38 --- /dev/null +++ b/elements/heat-jeos/install.d/10-ec2-user @@ -0,0 +1,26 @@ +#!/bin/bash +# Until http://pad.lv/1101347 is fixed, we need this user to be able to +# Log on to heat booted machines using the given SSH keypair + +set -uex + +# Setup ec2-user as expected by HEAT +if ! getent passwd ec2-user ; then + useradd -m -G admin ec2-user -s /bin/bash +fi +if ! [ -e /etc/sudoers.d/ec2-user ] ; then + echo "ec2-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ec2-user + chmod 0440 /etc/sudoers.d/ec2-user + visudo -c +fi + +# We must pin to this fixed cloud-init from the demo ppa to ensure keys +# are installed. This can be removed if http://pad.lv/1100920 is ever +# fixed in the distro +cat > /etc/apt/preferences.d/cloud-init-from-ppa <