summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/garage/meta/main.yml3
-rw-r--r--roles/garage/templates/garage-provision.sh.j25
2 files changed, 5 insertions, 3 deletions
diff --git a/roles/garage/meta/main.yml b/roles/garage/meta/main.yml
index e59db6e0..3efdd4e7 100644
--- a/roles/garage/meta/main.yml
+++ b/roles/garage/meta/main.yml
@@ -1,5 +1,6 @@
---
-dependencies: []
+dependencies:
+ - role: "curl"
galaxy_info:
author: "a14m"
description: "Install Garage S3-compatible object store"
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