diff --git a/roles/mgrote_minio_configure/defaults/main.yml b/roles/mgrote_minio_configure/defaults/main.yml index a25fe8d3..c6aa5bf0 100644 --- a/roles/mgrote_minio_configure/defaults/main.yml +++ b/roles/mgrote_minio_configure/defaults/main.yml @@ -14,19 +14,15 @@ minio_users: - name: testuser5 secret: hallowelt state: present - policies: - - testbucket1_rw + policy: testbucket1_rw - name: testuser6 secret: hallowelt2 state: present - policies: - - testbucket3_ro + policy: testbucket3_ro - name: testuserwer secret: hallowelt2 state: present - policies: - - testbucket3_ro - - testbucket1_rw + policy: testbucket3_ro minio_buckets: - name: testbucket1 diff --git a/roles/mgrote_minio_configure/tasks/main.yml b/roles/mgrote_minio_configure/tasks/main.yml index e4b6ee48..98b17bc3 100644 --- a/roles/mgrote_minio_configure/tasks/main.yml +++ b/roles/mgrote_minio_configure/tasks/main.yml @@ -27,6 +27,7 @@ dubzland.minio.minio_user: access_key: "{{ item.name }}" secret_key: "{{ item.secret }}" + policy: "{{ item.policy }}" auth: access_key: "{{ minio_root_access_key }}" secret_key: "{{ minio_root_secret_key }}" diff --git a/roles/mgrote_minio_configure/tasks/policy.yml b/roles/mgrote_minio_configure/tasks/policy.yml index e1ecd986..35813822 100644 --- a/roles/mgrote_minio_configure/tasks/policy.yml +++ b/roles/mgrote_minio_configure/tasks/policy.yml @@ -34,9 +34,5 @@ ansible.builtin.command: "{{ minio_client_bin }} --dp admin policy create {{ minio_root_alias }} {{ item.bucket }}_ro {{ minio_config_dir }}/{{ item.bucket }}_ro" loop: "{{ minio_policies }}" -- name: Assign MinIO policies to users - ansible.builtin.command: "{{ minio_client_bin }} --dp admin policy attach {{ minio_root_alias }} {{ item.1 }} --user {{ item.0.name }}" - loop: "{{ minio_users | subelements('policies') }}" - # ensure absent files are removed # deletata to localhost