feat(garage): add provisioning of and bootstraping

This commit is contained in:
Bert-Jan Fikse 2025-12-18 11:34:09 +01:00
parent 188a6f539f
commit 19986e1205
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
4 changed files with 194 additions and 5 deletions

View file

@ -42,4 +42,33 @@
- name: Start garage container
community.docker.docker_compose_v2:
project_src: "{{ garage_docker_compose_dir }}"
state: present
state: present
- name: Wait for garage container to be running
community.docker.docker_container_info:
name: "{{ garage_service_name }}"
register: _garage_container_info
until: _garage_container_info.container.State.Running | default(false)
retries: 30
delay: 2
- name: Wait for garage to be ready (check if garage command responds)
community.docker.docker_container_exec:
container: "{{ garage_service_name }}"
command: /garage status
register: _garage_status_check
until: _garage_status_check.rc == 0
retries: 30
delay: 2
changed_when: false
failed_when: false
# Include bootstraping tasks (cluster bootstrap)
- name: Include garage bootstraping tasks
ansible.builtin.include_tasks: bootstrap.yml
when: garage_bootstrap_enabled
# Include provisioning tasks (S3 keys and buckets)
- name: Include garage bootstraping tasks
ansible.builtin.include_tasks: provision.yml
when: garage_s3_keys | length > 0