homeserver/roles/mgrote_minio_configure/tasks/client.yml

33 lines
1.3 KiB
YAML
Raw Normal View History

2024-11-09 10:08:39 +01:00
---
2024-11-09 21:00:38 +01:00
# stolen and adapted from: https://github.com/atosatto/ansible-minio/blob/master/tasks/install-client.yml
2024-11-09 10:08:39 +01:00
- name: Compose the Minio client download base url
2024-11-09 10:49:40 +01:00
ansible.builtin.set_fact:
2024-11-09 10:08:39 +01:00
_minio_client_download_base_url: "https://dl.minio.io/client/mc/release/linux-amd64"
- name: Compose the Minio client download url with lastest release
2024-11-09 10:49:40 +01:00
ansible.builtin.set_fact:
2024-11-09 10:08:39 +01:00
_minio_client_download_url: "{{ _minio_client_download_base_url }}/mc"
2024-11-09 10:53:27 +01:00
when: minio_client_release | length == 0
2024-11-09 10:08:39 +01:00
- name: "Compose the Minio client download url with release {{ minio_client_release }}"
2024-11-09 10:49:40 +01:00
ansible.builtin.set_fact:
2024-11-09 10:08:39 +01:00
_minio_client_download_url: "{{ _minio_client_download_base_url }}/archive/mc.{{ minio_client_release }}"
2024-11-09 10:53:27 +01:00
when: minio_client_release | length > 0
2024-11-09 10:08:39 +01:00
- name: "Get the Minio client checksum for amd64 architecture"
2024-11-09 10:49:40 +01:00
ansible.builtin.set_fact:
2024-11-09 10:08:39 +01:00
_minio_client_checksum: "{{ lookup('url', _minio_client_download_url + '.sha256sum').split(' ')[0] }}"
- name: Download the Minio client
2024-11-09 10:49:40 +01:00
ansible.builtin.get_url:
2024-11-09 10:08:39 +01:00
url: "{{ _minio_client_download_url }}"
dest: "{{ minio_client_bin }}"
owner: "root"
group: "root"
mode: 0755
checksum: "sha256:{{ _minio_client_checksum }}"
register: _download_client
until: _download_client is succeeded
retries: 5
delay: 2