From ef5b01b10e987134cff7b10f4c595c4878fddc16 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 9 Nov 2024 10:16:52 +0100 Subject: [PATCH] user --- roles/mgrote_minio_configure/defaults/main.yml | 8 ++++++++ roles/mgrote_minio_configure/tasks/main.yml | 5 ++++- roles/mgrote_minio_configure/tasks/user.yml | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/roles/mgrote_minio_configure/defaults/main.yml b/roles/mgrote_minio_configure/defaults/main.yml index dda78b5e..24c251bb 100644 --- a/roles/mgrote_minio_configure/defaults/main.yml +++ b/roles/mgrote_minio_configure/defaults/main.yml @@ -3,3 +3,11 @@ minio_root_access_key: minio_root_secret_key: minio_root_alias: minio_ansible_root minio_url: https://s3.mgrote.net + +# --dp ausschreiben + +minio_users: + - name: testuser5 + secret: hallowelt + - name: testuser6 + secret: hallowelt2 diff --git a/roles/mgrote_minio_configure/tasks/main.yml b/roles/mgrote_minio_configure/tasks/main.yml index e05307dd..6aea6266 100644 --- a/roles/mgrote_minio_configure/tasks/main.yml +++ b/roles/mgrote_minio_configure/tasks/main.yml @@ -3,4 +3,7 @@ ansible.builtin.include_tasks: client.yml - name: ensure alias exists - ansible.builtin.command: "{{ minio_client_bin }} alias set {{ minio_root_alias }} {{ minio_url }} {{ minio_root_access_key }} {{ minio_root_secret_key }}" + ansible.builtin.command: "{{ minio_client_bin }} --dp alias set {{ minio_root_alias }} {{ minio_url }} {{ minio_root_access_key }} {{ minio_root_secret_key }}" + +- name: include user tasks + ansible.builtin.include_tasks: user.yml diff --git a/roles/mgrote_minio_configure/tasks/user.yml b/roles/mgrote_minio_configure/tasks/user.yml index e69de29b..25ea5fbc 100644 --- a/roles/mgrote_minio_configure/tasks/user.yml +++ b/roles/mgrote_minio_configure/tasks/user.yml @@ -0,0 +1,4 @@ +--- +- name: setup minio users + ansible.builtin.command: "{{ minio_client_bin }} --dp admin user add {{ minio_root_alias }} {{ item.user }} {{ item.secret }}" + loop: "{{ minio_users }}"