mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-30 15:37:44 +02:00
♻️ minio custom jail
This commit is contained in:
42
ansible/roles/minio/tasks/main.yml
Normal file
42
ansible/roles/minio/tasks/main.yml
Normal 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
|
Reference in New Issue
Block a user