Unset -e flag during humbug.pem login to preserve idempotency of install-server

(imported from commit d65b635a48ce33908b2888319a7c109d5d126b54)
This commit is contained in:
Leo Franchi 2013-07-23 12:12:52 -04:00
parent b5eab2bde5
commit bb2df13bfd
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,8 @@ fi
# we'll get key errors after puppet apply.
SSH_OPTS="-o HostKeyAlgorithms=ssh-rsa"
set +e
ssh $SSH_OPTS "$server" -t -i "$amazon_key_file" -ladmin <<EOF
sudo sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sudo mkdir ~root/.ssh && sudo cp .ssh/authorized_keys ~root/.ssh/authorized_keys
@ -39,6 +41,8 @@ sudo service ssh restart
EOF
set -e
ssh $SSH_OPTS "$server" -t -i "$amazon_key_file" -lroot <<EOF
echo "$hostname" > /etc/hostname
sed -i 's/localhost$/localhost $hostname/' /etc/hosts