diff options
| author | Ahmed AbdelHalim <[email protected]> | 2026-06-24 03:35:43 +0200 |
|---|---|---|
| committer | Ahmed AbdelHalim <[email protected]> | 2026-06-24 04:29:25 +0200 |
| commit | 1ff333019c1d86be8d5601c4b405cf106219915a (patch) | |
| tree | 74d6e29f8cb690ead814f217447f883de3f95c16 | |
| parent | c3df47e155048413ce67736a286b1b5d1e91deb9 (diff) | |
Add garage health check before provisioning keys
| -rw-r--r-- | molecule/raspberrypi/converge.yml | 4 | ||||
| -rw-r--r-- | roles/garage/meta/main.yml | 3 | ||||
| -rw-r--r-- | roles/garage/templates/garage-provision.sh.j2 | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/molecule/raspberrypi/converge.yml b/molecule/raspberrypi/converge.yml index 6887ff10..023d7154 100644 --- a/molecule/raspberrypi/converge.yml +++ b/molecule/raspberrypi/converge.yml @@ -92,6 +92,8 @@ - role: "prometheus" - role: "prometheus-node-exporter" - role: "grafana" + - role: "backup" + - role: "garage" - role: "gnome" - role: "gnome-calendar" - role: "gnome-loupe" @@ -115,5 +117,3 @@ - role: "pipewire" - role: "claude" - role: "localsend" - - role: "backup" - - role: "garage" 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 |
