ricsanfre / ansible-role-minio

Ansible role for installing and configuring Minio
https://galaxy.ansible.com/ricsanfre/minio
MIT License
50 stars 22 forks source link

Can't create a private bucket with the role #11

Closed S0obi closed 1 year ago

S0obi commented 1 year ago

Hello @ricsanfre, The minio_bucket.py library allows to provide an empty value for the policy field. Unfortunately, I was not able to find out how to provide a null value to the library, so that I can create a private bucket (no policy), instead of a public one with defined policy like "read-only". I am guessing that we should change the role code to something like :

- name: "Create Buckets"
  minio_bucket:
    s3_url: "{{ minio_url }}"
    region: "{{ minio_site_region }}"
    name: "{{ bucket.name† }}"
    access_key: "{{ minio_root_user }}"
    secret_key: "{{ minio_root_password }}"
    state: present
    policy: "{{ bucket.policy | default(omit) }}"
    validate_certs: false
  with_items:
    - "{{ minio_buckets }}"
  loop_control:
    loop_var: "bucket"

Thanks in advance for your help, Thibault