45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
---
|
|
- name: Create MinIO directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop:
|
|
- "{{ minio_data_dir }}"
|
|
- "{{ minio_data_dir }}/data"
|
|
|
|
- name: Deploy MinIO docker-compose
|
|
ansible.builtin.template:
|
|
src: docker-compose.yml.j2
|
|
dest: "{{ minio_data_dir }}/docker-compose.yml"
|
|
mode: '0644'
|
|
notify: restart minio
|
|
|
|
- name: Start MinIO
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ minio_data_dir }}"
|
|
state: present
|
|
when: not (molecule_test_mode | default(false))
|
|
|
|
- name: Wait for MinIO to be ready
|
|
ansible.builtin.uri:
|
|
url: "http://localhost:9010/minio/health/live"
|
|
method: GET
|
|
status_code: 200
|
|
register: result
|
|
until: result.status == 200
|
|
retries: 15
|
|
delay: 5
|
|
when: not (molecule_test_mode | default(false))
|
|
|
|
- name: Create Nextcloud bucket in MinIO
|
|
ansible.builtin.command:
|
|
cmd: >
|
|
docker run --rm --network host
|
|
--entrypoint /bin/sh
|
|
minio/mc:latest
|
|
-c "mc alias set local http://localhost:9010 {{ minio_root_user }} {{ minio_root_password }}
|
|
&& mc mb --ignore-existing local/{{ minio_nextcloud_bucket }}"
|
|
changed_when: false
|
|
when: not (molecule_test_mode | default(false))
|