summaryrefslogtreecommitdiffstats
path: root/roles/garage/templates
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-06-24 03:35:43 +0200
committerAhmed Abdelhalim <[email protected]>2026-06-24 04:29:25 +0200
commit54b59472a146cdad652f6cefcbdaece0f0f89e74 (patch)
tree74d6e29f8cb690ead814f217447f883de3f95c16 /roles/garage/templates
parentd7c5bf7b3e5ccf417e93c379ead83468b5703e22 (diff)
Add garage health check before provisioning keys
Diffstat (limited to 'roles/garage/templates')
-rw-r--r--roles/garage/templates/garage-provision.sh.j25
1 files changed, 3 insertions, 2 deletions
diff --git a/roles/garage/templates/garage-provision.sh.j2 b/roles/garage/templates/garage-provision.sh.j2
index 0402c926..1360c486 100644
--- a/roles/garage/templates/garage-provision.sh.j2
+++ b/roles/garage/templates/garage-provision.sh.j2
@@ -3,10 +3,11 @@ set -e
GARAGE="garage -c /etc/garage/garage.toml"
-if ! $GARAGE layout show 2>/dev/null | grep -q "Current cluster layout"; then
- NODE_ID=$($GARAGE node id -q | cut -d@ -f1)
+NODE_ID=$($GARAGE node id -q | cut -d@ -f1)
+if ! $GARAGE layout show 2>/dev/null | grep -q "$NODE_ID"; then
$GARAGE layout assign --zone dc1 --capacity {{ garage_capacity }} "$NODE_ID"
$GARAGE layout apply --version 1
+ curl -sf --retry 30 --retry-delay 1 --retry-all-errors http://127.0.0.1:{{ garage_admin_port }}/health
fi
if ! $GARAGE bucket list | grep -q "{{ garage_bucket }}"; then