setup minio automation #229

Merged
mg merged 114 commits from minio_automation into master 2024-11-09 22:00:58 +01:00
Showing only changes of commit a3975dbf83 - Show all commits

View file

@ -2,3 +2,43 @@
- name: setup minio users - name: setup minio users
ansible.builtin.command: "{{ minio_client_bin }} --dp admin user add {{ minio_root_alias }} {{ item.user }} {{ item.secret }}" ansible.builtin.command: "{{ minio_client_bin }} --dp admin user add {{ minio_root_alias }} {{ item.user }} {{ item.secret }}"
loop: "{{ minio_users }}" loop: "{{ minio_users }}"
register: users
# mg@irantu ~
# > ./mc --dp admin accesskey list minio_root --all
# User: m-admin
# Access Keys:
# 5ZK2AZQNMBDNO8WY5SKH, expires: 1 hour ago, sts: true
# Rk1UNoPzFfa6AeOXnVB7, expires: never, sts: false
# User: testuser1
# Access Keys:
# ekWgpsClIB5SDT2bJSqS, expires: never, sts: false
# 6ZP41ECPMGQM5IFXNN9E, expires: never, sts: false
# KFOB01AASUOQQ6PUZ0K2, expires: never, sts: false
# FYTEFK8ODQZOYFHCJUW7, expires: never, sts: false
# WIKS93B4323YI2WN0P5U, expires: never, sts: false
# User: testuser7
#
# mg@irantu ~
# > ./mc --dp admin accesskey list minio_root testuser7
# User: testuser7
1. check if user has access keys
2. when not create one, else skip
- name: get access keys
ansible.builtin.command: "{{ minio_client_bin }} --dp admin accesskey list {{ item.user }}"
loop: "{{ minio_users }}"
register: keys
- name: debug
ansible.uiltin.debug:
msg: "{{ keys }}"
- name: setup minio users
ansible.builtin.command: "{{ minio_client_bin }} --dp admin user add {{ minio_root_alias }} {{ item.user }} {{ item.secret }}"
loop: "{{ minio_users }}"
when: keys
# mehrere keys pro user?
# wie ausgeben?