setup minio automation #229
3 changed files with 10 additions and 15 deletions
|
@ -1,13 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Block bucket creation with error handling
|
- name: Add a Minio bucket
|
||||||
block:
|
dubzland.minio.minio_bucket:
|
||||||
- name: Setup MinIO buckets
|
name: "{{ item.name }}"
|
||||||
ansible.builtin.command: "{{ minio_client_bin }} --dp mb {{ minio_root_alias }}/{{ item.name }}"
|
auth:
|
||||||
loop: "{{ minio_buckets }}"
|
access_key: "{{ minio_root_access_key }}"
|
||||||
register: buckets
|
secret_key: "{{ minio_root_secret_key }}"
|
||||||
rescue:
|
url: "{{ minio_url }}"
|
||||||
- name: Check if bucket already exists
|
state: present
|
||||||
ansible.builtin.debug:
|
loop: "{{ minio_buckets }}"
|
||||||
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'
|
|
||||||
|
|
|
@ -34,9 +34,6 @@
|
||||||
- name: include bucket tasks
|
- name: include bucket tasks
|
||||||
ansible.builtin.include_tasks: bucket.yml
|
ansible.builtin.include_tasks: bucket.yml
|
||||||
|
|
||||||
- name: include policy tasks
|
|
||||||
ansible.builtin.include_tasks: policy.yml
|
|
||||||
|
|
||||||
- name: get all access keys (is set to true)
|
- name: get all access keys (is set to true)
|
||||||
ansible.builtin.command: "{{ minio_client_bin }} --dp admin accesskey list {{ minio_root_alias }} --all"
|
ansible.builtin.command: "{{ minio_client_bin }} --dp admin accesskey list {{ minio_root_alias }} --all"
|
||||||
when: minio_print_keys
|
when: minio_print_keys
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
# https://galaxy.ansible.com/ui/repo/published/dubzland/minio/content/module/minio_policy/ ?
|
||||||
- name: create needed dirs
|
- name: create needed dirs
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ minio_config_dir }}"
|
path: "{{ minio_config_dir }}"
|
||||||
|
|
Loading…
Reference in a new issue