From 58ebef302c2bd1a564d38a29db6d9304f41ef18b Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Wed, 3 Jun 2015 10:46:28 +0300 Subject: [PATCH] Fix manila-ssh element --- elements/manila-ssh/install.d/fetch-public-ssh-keys.sh | 8 +++----- elements/manila-ssh/package-installs.yaml | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 elements/manila-ssh/package-installs.yaml diff --git a/elements/manila-ssh/install.d/fetch-public-ssh-keys.sh b/elements/manila-ssh/install.d/fetch-public-ssh-keys.sh index 6f58175..88bd3e9 100755 --- a/elements/manila-ssh/install.d/fetch-public-ssh-keys.sh +++ b/elements/manila-ssh/install.d/fetch-public-ssh-keys.sh @@ -1,8 +1,6 @@ #!/bin/bash set -x -set -eu -set -o pipefail MANILA_USER="manila" MANILA_USER_HOME="/home/$MANILA_USER" @@ -11,6 +9,7 @@ MANILA_USER_SSH_DIR="$MANILA_USER_HOME/.ssh" if [ ! -d $MANILA_USER_SSH_DIR ]; then mkdir -p $MANILA_USER_SSH_DIR chmod 700 $MANILA_USER_SSH_DIR + chown -R $MANILA_USER $MANILA_USER_SSH_DIR fi # Fetch public key using HTTP @@ -21,6 +20,7 @@ while [ ! -f $MANILA_USER_SSH_DIR/authorized_keys ]; do if [ $? -eq 0 ]; then cat /tmp/metadata-key >> $MANILA_USER_SSH_DIR/authorized_keys chmod 0600 $MANILA_USER_SSH_DIR/authorized_keys + chown $MANILA_USER $MANILA_USER_SSH_DIR/authorized_keys rm -f /tmp/metadata-key echo "Successfully retrieved public key from instance metadata" echo "*****************" @@ -37,6 +37,4 @@ while [ ! -f $MANILA_USER_SSH_DIR/authorized_keys ]; do echo "Could not retrieve public key from instance metadata (attempt #$FAILED/$ATTEMPTS), retrying in 5 seconds..." sleep 5 fi -done - -chown -R $MANILA_USER $MANILA_USER_SSH_DIR \ No newline at end of file +done \ No newline at end of file diff --git a/elements/manila-ssh/package-installs.yaml b/elements/manila-ssh/package-installs.yaml new file mode 100644 index 0000000..73d2bb3 --- /dev/null +++ b/elements/manila-ssh/package-installs.yaml @@ -0,0 +1 @@ +curl: \ No newline at end of file