homeserver/roles/mgrote_minio_configure/tasks/bucket.yml
2024-11-09 18:41:42 +01:00

13 lines
547 B
YAML

---
- name: Block bucket creation with error handling
block:
- name: Setup MinIO buckets
ansible.builtin.command: "{{ minio_client_bin }} --dp mb {{ minio_root_alias }}/{{ item.name }}"
loop: "{{ minio_buckets }}"
register: buckets
rescue:
- name: Check if bucket already exists
ansible.builtin.debug:
msg: "Bucket {{ item.item.name }} already exists."
loop: "{{ buckets.results }}"
when: '"Your previous request to create the named bucket succeeded and you already own it." in item.stderr'