Fix manila-ssh element
This commit is contained in:
parent
6105509863
commit
58ebef302c
@ -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
|
||||
done
|
1
elements/manila-ssh/package-installs.yaml
Normal file
1
elements/manila-ssh/package-installs.yaml
Normal file
@ -0,0 +1 @@
|
||||
curl:
|
Loading…
Reference in New Issue
Block a user