/usr/share/tripleo-image-elements/heat-cfntools/install.d/10-ec2-user is in python-tripleo-image-elements 0.7.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #!/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
# This is a specific workaround for Ubuntu 12.10 "quantal"
distro=$(lsb_release -is || :)
if [ "$distro" != "Ubuntu" ] ; then
exit 0
fi
codename=$(lsb_release -cs || :)
if [ "$codename" != "quantal" ] ; then
exit 0
fi
# 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
add-apt-repository -y ppa:tripleo/demo
apt-get update
cat > /etc/apt/preferences.d/cloud-init-from-ppa <<EOF
Package: cloud-init
Pin: release o=LP-PPA-tripleo-demo
Pin-Priority: 900
EOF
# Should pull from demo PPA if cloud-init exists there.
# Since this is Ubuntu only, the --force-yes is OK
install-packages --force-yes cloud-init
|