From e99b851624813f165fc80d69140a5c9fd1f57f67 Mon Sep 17 00:00:00 2001 From: Sebastian Haderecker Date: Tue, 9 Apr 2019 06:14:57 +0000 Subject: [PATCH] Only proceed on ECS build success Wrap the Ansible Playbook command in a condition. Only execute it when the ECS build process was sucessful. Otherwise display an error message and abort. --- cloud/deploy_ansible_otc_t-pot.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cloud/deploy_ansible_otc_t-pot.sh b/cloud/deploy_ansible_otc_t-pot.sh index 8f4c7366..f32b31cf 100755 --- a/cloud/deploy_ansible_otc_t-pot.sh +++ b/cloud/deploy_ansible_otc_t-pot.sh @@ -40,6 +40,8 @@ echo "### Creating new ECS host via OTC API..." --wait \ 2> /dev/null +if [ $? -eq 0 ]; then + if [ "$(uname)" == "Darwin" ]; then PUBIP=$(./otc-tools/otc.sh ecs list 2>/dev/null | grep $HPNAME|cut -d "," -f2 |cut -d "\"" -f 2) else @@ -55,3 +57,11 @@ echo "***********************************************" echo "***** SSH TO TARGET: " echo "***** ssh linux@$PUBIP -p 64295" echo "***********************************************" + +else + +echo "ECS creation unsuccessful. Aborting..." +echo "Hint: Check your EIP or ECS quotas as these limits are a common error." +echo "For further output, comment out '2> /dev/null' in the ECS creation command." + +fi