From 4bb9d734f17ce31e2c5ab3c20ed927be48d95801 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 9 Nov 2024 21:09:22 +0100 Subject: [PATCH] =?UTF-8?q?policies=20=C3=BCber=20bucket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/mgrote_minio_configure/defaults/main.yml | 9 ++------- roles/mgrote_minio_configure/tasks/policy.yml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/roles/mgrote_minio_configure/defaults/main.yml b/roles/mgrote_minio_configure/defaults/main.yml index 0cc8af0f..c4403451 100644 --- a/roles/mgrote_minio_configure/defaults/main.yml +++ b/roles/mgrote_minio_configure/defaults/main.yml @@ -25,14 +25,9 @@ minio_users: policy: testbucket3_ro minio_buckets: - - name: testbucket1 - - name: testbucket3 + - testbucket1 + - testbucket3 -minio_policies: # pro nucket nur eine policy? - - bucket: testbucket1 - policy: rw - - bucket: testbucket3 - policy: ro # auf docker10 aufraumen # und irtantu diff --git a/roles/mgrote_minio_configure/tasks/policy.yml b/roles/mgrote_minio_configure/tasks/policy.yml index b8da4370..b94b331c 100644 --- a/roles/mgrote_minio_configure/tasks/policy.yml +++ b/roles/mgrote_minio_configure/tasks/policy.yml @@ -10,29 +10,29 @@ - name: "prep: template policy files (ro)" ansible.builtin.template: - dest: "{{ minio_config_dir }}/{{ item.bucket }}_ro" + dest: "{{ minio_config_dir }}/{{ item }}_ro" src: policy_ro.j2 owner: root group: root mode: '0644' - loop: "{{ minio_policies }}" + loop: "{{ minio_buckets }}" - name: "prep: template policy files (rw)" ansible.builtin.template: - dest: "{{ minio_config_dir }}/{{ item.bucket }}_rw" + dest: "{{ minio_config_dir }}/{{ item }}_rw" src: policy_rw.j2 owner: root group: root mode: '0644' - loop: "{{ minio_policies }}" + loop: "{{ minio_buckets }}" - name: "setup policies (ro)" - 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 }}" + ansible.builtin.command: "{{ minio_client_bin }} --dp admin policy create {{ minio_root_alias }} {{ item }}_ro {{ minio_config_dir }}/{{ item }}_ro" + loop: "{{ minio_buckets }}" - name: "setup policies (rw)" - ansible.builtin.command: "{{ minio_client_bin }} --dp admin policy create {{ minio_root_alias }} {{ item.bucket }}_rw {{ minio_config_dir }}/{{ item.bucket }}_rw" - loop: "{{ minio_policies }}" + ansible.builtin.command: "{{ minio_client_bin }} --dp admin policy create {{ minio_root_alias }} {{ item }}_rw {{ minio_config_dir }}/{{ item }}_rw" + loop: "{{ minio_buckets }}" # ensure absent files are removed # deletata to localhost