feat: add basic garage s3 storage role

This commit is contained in:
Bert-Jan Fikse 2025-11-07 17:35:32 +01:00
parent 69bc95b992
commit 5377c34709
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
11 changed files with 344 additions and 0 deletions

View file

@ -0,0 +1,45 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for garage
- name: Create docker compose directory
file:
path: "{{ garage_docker_compose_dir }}"
state: directory
mode: '0755'
- name: Create garage meta data directory
file:
path: "{{ garage_docker_volume_dir }}/meta"
state: directory
mode: '0755'
- name: Create garage data directory
file:
path: "{{ garage_docker_volume_dir }}/data"
state: directory
mode: '0755'
- name: Generate garage configuration file
template:
src: garage.toml.j2
dest: "{{ garage_docker_compose_dir }}/garage.toml"
mode: '0644'
- name: Generate bcrypt hash for webui password using htpasswd
ansible.builtin.shell: |
htpasswd -nbBC 10 "{{ garage_webui_username }}" "{{ garage_webui_password }}"
register: _garage_webui_password_hash
changed_when: false
when: garage_webui_enabled
- name: Create docker-compose file for garage
template:
src: docker-compose.yml.j2
dest: "{{ garage_docker_compose_dir }}/docker-compose.yml"
mode: '0644'
- name: Start garage container
community.docker.docker_compose_v2:
project_src: "{{ garage_docker_compose_dir }}"
state: present