Skip to content

Commit a743aa2

Browse files
committed
wip: Exit polling loop if status is complete, both password and ip are set
1 parent 592cbdf commit a743aa2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/create-instance.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,20 @@ jobs:
148148
jq -r .exoSetup | \
149149
jq -r .status)
150150
151-
if [ "$status" = "complete" ]; then
151+
has_pwd=$(
152+
openstack server show $INSTANCE_NAME -c tags -f json | \
153+
jq -r '.tags[] | startswith("exoPw")')
154+
155+
has_ip=$(
156+
openstack server show $INSTANCE_NAME -c addresses -f json | \
157+
jq -r '.addresses.auto_allocated_network[1] != null'
158+
)
159+
160+
if [ "$status" = "complete" && has_pwd $$ $has_ip ]; then
152161
echo "Status is complete. Exiting loop."
153162
break
154163
else
155-
echo "Status is $status. Waiting for completion..."
164+
echo "Status is '$status', has_pwd is '$has_pwd', has_ip is '$has_ip'. Waiting for completion..."
156165
sleep $wait_interval
157166
total_wait_time=$((total_wait_time + wait_interval))
158167
fi

0 commit comments

Comments
 (0)