From 3b8acfc3049196ef0892d231d0c4c6307150c846 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 9 Nov 2024 11:10:18 +0100 Subject: [PATCH] ff --- roles/mgrote_minio_configure/tasks/user.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/mgrote_minio_configure/tasks/user.yml b/roles/mgrote_minio_configure/tasks/user.yml index dcfe9bf6..c1266fe3 100644 --- a/roles/mgrote_minio_configure/tasks/user.yml +++ b/roles/mgrote_minio_configure/tasks/user.yml @@ -27,7 +27,7 @@ # 2. when not create one, else skip # whe exist, then display if param is set -- name: get access keys +- name: Get access keys for each user ansible.builtin.command: "{{ minio_client_bin }} --dp admin accesskey list {{ minio_root_alias }} {{ item.name }}" loop: "{{ minio_users }}" register: keys @@ -38,10 +38,12 @@ loop: "{{ keys.results }}" when: "'Access Keys:' in item.stdout" -- name: setup minio users - ansible.builtin.command: "{{ minio_client_bin }} --dp admin user add {{ minio_root_alias }} {{ item.name }} {{ item.secret }}" - loop: "{{ minio_users }}" - when: keys +- name: Create access keys for users without them + ansible.builtin.command: "{{ minio_client_bin }} --dp admin accesskey create {{ minio_root_alias }} {{ item.item.name }}" + loop: "{{ keys.results }}" + when: "'Access Keys:' not in item.stdout" + + # mehrere keys pro user? # wie ausgeben?