Fix bash loop syntax in API readiness check
Change from brace expansion to while loop for better portability.
This commit is contained in:
parent
2ccdf4aebf
commit
64e76036b2
1 changed files with 3 additions and 1 deletions
|
|
@ -7,13 +7,15 @@
|
||||||
|
|
||||||
- name: Wait for Authentik API to be ready
|
- name: Wait for Authentik API to be ready
|
||||||
shell: |
|
shell: |
|
||||||
for i in {1..30}; do
|
i=1
|
||||||
|
while [ $i -le 30 ]; do
|
||||||
if docker exec authentik-server curl -sf -H "Authorization: Bearer {{ authentik_api_token }}" http://localhost:9000/api/v3/core/tenants/ > /dev/null 2>&1; then
|
if docker exec authentik-server curl -sf -H "Authorization: Bearer {{ authentik_api_token }}" http://localhost:9000/api/v3/core/tenants/ > /dev/null 2>&1; then
|
||||||
echo "Authentik API is ready"
|
echo "Authentik API is ready"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Waiting for Authentik API... attempt $i/30"
|
echo "Waiting for Authentik API... attempt $i/30"
|
||||||
sleep 5
|
sleep 5
|
||||||
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
exit 1
|
exit 1
|
||||||
register: api_wait
|
register: api_wait
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue