remove minio (#252)
All checks were successful
ansible-lint / gitleaks (push) Successful in 6s
ansible-lint / Ansible Lint (push) Successful in 42s

Reviewed-on: #252
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2024-11-25 18:52:01 +01:00 committed by Michael Grote
parent 61fc3f4afb
commit e0f8219b8f
10 changed files with 10 additions and 20 deletions

View file

@ -8,9 +8,11 @@
url: "{{ minio_url }}" url: "{{ minio_url }}"
state: "{{ item.state | default('present') }}" state: "{{ item.state | default('present') }}"
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
delegate_to: localhost
- name: Deletion Info - name: Deletion Info
ansible.builtin.debug: ansible.builtin.debug:
msg: "Deletion only possible with empty bucket ({{ item.name }})" msg: "Deletion only possible with empty bucket ({{ item.name }})"
when: '"absent" in item.state' when: '"absent" in item.state'
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
delegate_to: localhost

View file

@ -12,6 +12,7 @@
access_key: "{{ minio_root_access_key }}" access_key: "{{ minio_root_access_key }}"
secret_key: "{{ minio_root_secret_key }}" secret_key: "{{ minio_root_secret_key }}"
state: present state: present
delegate_to: localhost
- name: include policy tasks - name: include policy tasks
ansible.builtin.include_tasks: policy.yml ansible.builtin.include_tasks: policy.yml
@ -31,6 +32,7 @@
state: "{{ item.state | default('present') }}" state: "{{ item.state | default('present') }}"
loop: "{{ minio_users }}" loop: "{{ minio_users }}"
no_log: "{{ no_debug | default('true') }}" no_log: "{{ no_debug | default('true') }}"
delegate_to: localhost
# Bug: delegate_to: localhost # Bug: delegate_to: localhost
# in ansible-devspace wird das Python Paket "minio" nicht gefunden # in ansible-devspace wird das Python Paket "minio" nicht gefunden

View file

@ -7,6 +7,7 @@
owner: root owner: root
group: root group: root
mode: '0644' mode: '0644'
delegate_to: localhost
- name: "prep: template policy files (ro)" - name: "prep: template policy files (ro)"
ansible.builtin.template: ansible.builtin.template:
@ -16,6 +17,7 @@
group: root group: root
mode: '0644' mode: '0644'
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
delegate_to: localhost
- name: "prep: template policy files (rw)" - name: "prep: template policy files (rw)"
ansible.builtin.template: ansible.builtin.template:
@ -25,16 +27,19 @@
group: root group: root
mode: '0644' mode: '0644'
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
delegate_to: localhost
- name: "setup policies (ro)" - name: "setup policies (ro)"
ansible.builtin.command: "{{ minio_client_bin }} --disable-pager admin policy create {{ minio_root_alias }} {{ item.name }}_ro {{ minio_config_dir }}/{{ item.name }}_ro" ansible.builtin.command: "{{ minio_client_bin }} --disable-pager admin policy create {{ minio_root_alias }} {{ item.name }}_ro {{ minio_config_dir }}/{{ item.name }}_ro"
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
changed_when: false # Befehl gibt immer "Created policy `testbucket3_ro` successfully." aus, unabhängig ob sie schon existiert oder nicht. changed_when: false # Befehl gibt immer "Created policy `testbucket3_ro` successfully." aus, unabhängig ob sie schon existiert oder nicht.
delegate_to: localhost
- name: "setup policies (rw)" - name: "setup policies (rw)"
ansible.builtin.command: "{{ minio_client_bin }} --disable-pager admin policy create {{ minio_root_alias }} {{ item.name }}_rw {{ minio_config_dir }}/{{ item.name }}_rw" ansible.builtin.command: "{{ minio_client_bin }} --disable-pager admin policy create {{ minio_root_alias }} {{ item.name }}_rw {{ minio_config_dir }}/{{ item.name }}_rw"
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
changed_when: false # Befehl gibt immer "Created policy `testbucket3_ro` successfully." aus, unabhängig ob sie schon existiert oder nicht. changed_when: false # Befehl gibt immer "Created policy `testbucket3_ro` successfully." aus, unabhängig ob sie schon existiert oder nicht.
delegate_to: localhost
- name: "remove old policy files" - name: "remove old policy files"
ansible.builtin.file: ansible.builtin.file:
@ -42,3 +47,4 @@
state: absent state: absent
loop: "{{ minio_buckets }}" loop: "{{ minio_buckets }}"
when: '"absent" in item.state' when: '"absent" in item.state'
delegate_to: localhost

View file

@ -1,17 +1,4 @@
--- ---
### mgrote_minio_configure
minio_url: https://s3.mgrote.net
minio_root_access_key: "{{ lookup('viczem.keepass.keepass', 'minio/minio_root_access_key', 'password') }}"
minio_root_secret_key: "{{ lookup('viczem.keepass.keepass', 'minio/minio_root_secret_key', 'password') }}"
minio_users:
- name: testuser
secret: "{{ lookup('viczem.keepass.keepass', 'minio/minio_testuser_secret_key', 'password') }}"
state: present
policy: testbucket_rw
minio_buckets:
- name: testbucket
state: present
### mrlesmithjr.manage_lvm ### mrlesmithjr.manage_lvm
lvm_groups: lvm_groups:
- vgname: vg_docker - vgname: vg_docker
@ -32,7 +19,6 @@ pvresize_to_max: true
pip_package: python3-pip pip_package: python3-pip
pip_install_packages: pip_install_packages:
- name: docker # für munin-plugin docker_ - name: docker # für munin-plugin docker_
- name: minio # für ansible-minio_configure-Rolle
### mgrote.apt_manage_packages ### mgrote.apt_manage_packages
apt_packages_extra: apt_packages_extra:

View file

@ -53,9 +53,6 @@ compose_files:
- name: lldap - name: lldap
state: present state: present
network: traefik network: traefik
- name: minio
state: present
network: traefik
### oefenweb.ufw ### oefenweb.ufw
ufw_rules: ufw_rules:

View file

@ -25,6 +25,3 @@
- role: mgrote_docker_housekeeping - role: mgrote_docker_housekeeping
tags: "housekeeping" tags: "housekeeping"
become: true become: true
- role: mgrote_minio_configure
tags: "minio"
become: true