♻️ minio custom jail

This commit is contained in:
auricom
2024-01-09 16:52:29 +01:00
parent 9fe75c2b3c
commit badd042d50
15 changed files with 129 additions and 13 deletions

View File

@@ -0,0 +1,42 @@
---
- name: Install MinIO
ansible.builtin.pkgng:
name:
- minio
- curl
state: latest
register: installation
- name: Create MinIO configuration in /etc/rc.conf
ansible.builtin.blockinfile:
path: /etc/rc.conf
state: present
block: |
# MINIO
minio_enable="YES"
minio_disks="/mnt/data"
minio_env="MINIO_ACCESS_KEY={{ minio_access_key }} MINIO_SECRET_KEY={{ minio_secret_key }} MINIO_CONSOLE_ADDRESS=192.168.9.14:9001"
no_log: false
register: configuration
- name: Restart MinIO Service
ansible.builtin.service:
name: minio
state: restarted
enabled: true
when: configuration.changed == true or installation.changed == true
- name: Wait for 5 seconds
ansible.builtin.pause:
seconds: 5
- name: Check MinIO Service
ansible.builtin.command: curl -s localhost:9000/minio/health/live
register: curl_result
ignore_errors: true
changed_when: false
- name: Fail if curl command failed
ansible.builtin.fail:
msg: 'Curl command failed'
when: curl_result.rc != 0