From d271d938393dae349bda3bd4affb764b3b8768b5 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 9 Nov 2024 10:08:39 +0100 Subject: [PATCH] client --- .../mgrote_minio_configure/defaults/main.yml | 67 ------------------- roles/mgrote_minio_configure/tasks/client.yml | 31 +++++++++ 2 files changed, 31 insertions(+), 67 deletions(-) create mode 100644 roles/mgrote_minio_configure/tasks/client.yml diff --git a/roles/mgrote_minio_configure/defaults/main.yml b/roles/mgrote_minio_configure/defaults/main.yml index b1dc2fc1..ed97d539 100644 --- a/roles/mgrote_minio_configure/defaults/main.yml +++ b/roles/mgrote_minio_configure/defaults/main.yml @@ -1,68 +1 @@ --- -# Docs in config.yml and https://0xerr0r.github.io/blocky/configuration/ - -blocky_user: blocky -blocky_group: blocky -blocky_version: v0.22 -blocky_arch: x86_64 -blocky_download_url: "https://github.com/0xERR0R/blocky/releases/download/{{ blocky_version }}/blocky_{{ blocky_version }}_Linux_{{ blocky_arch }}.tar.gz" -blocky_conf_dir: /etc/blocky -blocky_block_type: zeroIp -blocky_block_ttl: 1m -blocky_blacklists_strategy: failOnError -blocky_local_upstream: 192.168.2.1 -blocky_prometheus: false -blocky_fqdn_only: false -blocky_port_dns: 53 -blocky_log_level: info -blocky_dns_upstream: - - 9.9.9.9 - - 1.1.1.1 - - 8.8.8.8 - - 5.9.164.112 -blocky_dns_blocklists: - - https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt - - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts - - http://sysctl.org/cameleon/hosts - - https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt -#blocky_custom_lookups: # optional -# # Internet -# - name: wiki.mgrote.net -# ip: 192.168.2.43 -# - name: audio.mgrote.net -# ip: 192.168.2.43 -# - name: auth.mgrote.net -# ip: 192.168.2.43 -# - name: ci.mgrote.net -# ip: 192.168.2.43 -# - name: git.mgrote.net -# ip: 192.168.2.43 -# - name: miniflux.mgrote.net -# ip: 192.168.2.43 -# - name: nextcloud.mgrote.net -# ip: 192.168.2.43 -# - name: registry.mgrote.net -# ip: 192.168.2.43 -# # Intern -# - name: ads2700w.mgrote.net -# ip: 192.168.2.147 -# - name: crs305.mgrote.net -# ip: 192.168.2.225 -# - name: hex.mgrote.net -# ip: 192.168.3.144 -# - name: pbs-test.mgrote.net -# ip: 192.168.2.18 -# - name: pbs.mgrote.net -# ip: 192.168.3.239 -# - name: pve5-test.mgrote.net -# ip: 192.168.2.17 -# - name: pve5.mgrote.net # bleibt im Router auch angelegt, weil wenn pve aus auch kein blocky ;-) -# ip: 192.168.2.16 -# - name: rb5009.mgrote.net -# ip: 192.168.2.1 -# - name: fritz.box -# ip: 192.168.5.1 -#blocky_conditional_mapping: # optional -# - domain: mgrote.net -# resolver: 192.168.2.1 -# diff --git a/roles/mgrote_minio_configure/tasks/client.yml b/roles/mgrote_minio_configure/tasks/client.yml new file mode 100644 index 00000000..75a93f2e --- /dev/null +++ b/roles/mgrote_minio_configure/tasks/client.yml @@ -0,0 +1,31 @@ +--- +- name: Compose the Minio client download base url + set_fact: + _minio_client_download_base_url: "https://dl.minio.io/client/mc/release/linux-amd64" + +- name: Compose the Minio client download url with lastest release + set_fact: + _minio_client_download_url: "{{ _minio_client_download_base_url }}/mc" + when: minio_client_release | length == 0 + +- name: "Compose the Minio client download url with release {{ minio_client_release }}" + set_fact: + _minio_client_download_url: "{{ _minio_client_download_base_url }}/archive/mc.{{ minio_client_release }}" + when: minio_client_release | length > 0 + +- name: "Get the Minio client checksum for amd64 architecture" + set_fact: + _minio_client_checksum: "{{ lookup('url', _minio_client_download_url + '.sha256sum').split(' ')[0] }}" + +- name: Download the Minio client + get_url: + 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