mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-05-13 19:58:08 +00:00
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.
This commit is contained in:
parent
baa7294024
commit
e99b851624
1 changed files with 10 additions and 0 deletions
|
@ -40,6 +40,8 @@ echo "### Creating new ECS host via OTC API..."
|
||||||
--wait \
|
--wait \
|
||||||
2> /dev/null
|
2> /dev/null
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
PUBIP=$(./otc-tools/otc.sh ecs list 2>/dev/null | grep $HPNAME|cut -d "," -f2 |cut -d "\"" -f 2)
|
PUBIP=$(./otc-tools/otc.sh ecs list 2>/dev/null | grep $HPNAME|cut -d "," -f2 |cut -d "\"" -f 2)
|
||||||
else
|
else
|
||||||
|
@ -55,3 +57,11 @@ echo "***********************************************"
|
||||||
echo "***** SSH TO TARGET: "
|
echo "***** SSH TO TARGET: "
|
||||||
echo "***** ssh linux@$PUBIP -p 64295"
|
echo "***** ssh linux@$PUBIP -p 64295"
|
||||||
echo "***********************************************"
|
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
|
||||||
|
|
Loading…
Reference in a new issue