Skip to content

Commit

Permalink
assume keycloak is available
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Apr 28, 2025
1 parent 2e90c72 commit bb7ad9a
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions config_job.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,6 @@ GRANT
return 1
}
# Wait for Keycloak to be ready
function wait_for_keycloak {
local max_attempts=30
local attempt=1
echo "Waiting for Keycloak to be ready..."
while [ $attempt -le $max_attempts ]; do
echo "Keycloak check attempt $attempt of $max_attempts"
if curl -s -o /dev/null -w %%{http_code} $KC_URL/auth/health/ready | grep -q "200"; then
echo "Keycloak is ready"
return 0
else
echo "Keycloak not ready, waiting..."
sleep 10
attempt=$((attempt+1))
fi
done
echo "Keycloak failed to become ready after $max_attempts attempts"
return 1
}
# Function to login to Keycloak admin console
function login {
local token=$(curl -s -X POST "$KC_URL/auth/realms/master/protocol/openid-connect/token" \
Expand Down Expand Up @@ -332,11 +309,6 @@ GRANT
# Fix PostgreSQL permissions for metrics
fix_metrics_permissions
# Wait for Keycloak to be ready
wait_for_keycloak || {
echo "Failed waiting for Keycloak"
exit 1
}
# Login to Keycloak
Expand Down

0 comments on commit bb7ad9a

Please sign in to comment.