--- # MinIO — S3-compatible object storage for model artifacts and datasets - name: Download MinIO server binary get_url: url: https://dl.min.io/server/minio/release/linux-amd64/minio dest: /usr/local/bin/minio mode: "0755" retries: 3 delay: 10 - name: Download MinIO client (mc) get_url: url: https://dl.min.io/client/mc/release/linux-amd64/mc dest: /usr/local/bin/mc mode: "0755" retries: 3 delay: 10 - name: Create MinIO data directories file: path: "{{ item }}" state: directory owner: cezen group: cezen mode: "0750" loop: - /opt/cezen/data/minio - /opt/cezen/data/minio/models - /opt/cezen/data/minio/datasets - name: Create MinIO environment file copy: dest: /etc/default/minio content: | MINIO_ROOT_USER=cezenadmin MINIO_ROOT_PASSWORD=Cezen@2024! MINIO_VOLUMES=/opt/cezen/data/minio mode: "0640" owner: root group: root - name: Create MinIO systemd service copy: dest: /etc/systemd/system/minio.service # Use | block to avoid Ansible interpreting $ signs content: "{{ minio_service }}" vars: minio_service: | [Unit] Description=MinIO Object Storage Documentation=https://docs.min.io Wants=network-online.target After=network-online.target [Service] User=cezen Group=cezen EnvironmentFile=/etc/default/minio ExecStart=/usr/local/bin/minio server $MINIO_VOLUMES Restart=always RestartSec=5 LimitNOFILE=65536 [Install] WantedBy=multi-user.target - name: Enable and start MinIO systemd: name: minio enabled: yes state: restarted daemon_reload: yes - name: Wait for MinIO API to be ready wait_for: host: localhost port: 9000 timeout: 60 ignore_errors: true - name: Configure mc client with local MinIO become_user: cezen shell: | mc alias set local http://localhost:9000 cezenadmin 'Cezen@2024!' mc mb local/models --ignore-existing mc mb local/datasets --ignore-existing retries: 3 delay: 10 ignore_errors: true