aboutsummaryrefslogtreecommitdiff
path: root/ansible/minio-policies.yml
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-09 12:33:17 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-09 12:33:17 +0100
commit16795884f3e915ed6d8b086fd5b6b93fc4858a27 (patch)
tree2043154f60fd396e5ee9f572df0dc9112f46feff /ansible/minio-policies.yml
parent4dd314376968d99abe67e1c49ad8032d3a2b96c2 (diff)
parent5b1279c3dd28a2c0252624c36e937c59db15270d (diff)
downloadinfra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.gz
infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.bz2
infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.xz
infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.zip
Merge branch 'master' of trygvis.io:git/infra
Diffstat (limited to 'ansible/minio-policies.yml')
-rw-r--r--ansible/minio-policies.yml49
1 files changed, 0 insertions, 49 deletions
diff --git a/ansible/minio-policies.yml b/ansible/minio-policies.yml
deleted file mode 100644
index 536314c..0000000
--- a/ansible/minio-policies.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-- hosts: localhost
- tasks:
- - command: mc admin user list --json "{{ minio_config }}"
- register: cmd_users
- # - debug: var=cmd_users.stdout
-
-- hosts: localhost
- tasks:
- - with_items: "{{ backup_policies }}"
- include_tasks: minio/backup-policy.yml
- vars:
- hostname: "{{ item }}"
- host: "{{ minio_users['backup-' + item] }}"
-
-- hosts: localhost
- vars:
- registered_minio_users: "{{ cmd_users.stdout_lines | map('from_json') | list }}"
- present_users: "{{ minio_users | dict2items | json_query('[] | [?value.state == `present`]') | items2dict }}"
- absent_users: "{{ minio_users | dict2items | json_query('[] | [?value.state == `absent`]') | items2dict }}"
- tasks:
- - name: all present users
- debug:
- msg: "{{ present_users | join(', ') }}"
- when: false
-
- - name: all absent users
- debug:
- msg: "{{ absent_users | join(', ') }}"
- when: false
-
- - name: all minio users
- debug:
- msg: "{{ registered_minio_users }}"
- when: false
-
- - name: Adding user to Minio
- command: "mc admin user add {{ minio_config }} {{ item }} {{ user.secret }} {{ user.policy }}"
- when: user_count == "0"
- vars:
- user: "{{ minio_users[item] }}"
- user_count: "{{ registered_minio_users | json_query('[] | [?accessKey == `' + item + '`]') | length }}"
- with_items: "{{ present_users }}"
-
- - name: Removing user from Minio
- command: "mc admin user remove {{ minio_config }} {{ item }}"
- when: user_count
- vars:
- user_count: "{{ registered_minio_users | json_query('[] | [?accessKey == `' + item + '`]') | length }}"
- with_items: "{{ absent_users }}"