Containerized Ansible role for automated MinIO server initialization and configuration.
- Automated MinIO server configuration using Ansible
- User and access key management
- Bucket creation and configuration
- Runs in a containerized environment
- Uses official MinIO client (mc) for operations
- Docker
- MinIO server instance
- Network connectivity to MinIO server
-
Build the container:
docker build -t minio-init .
-
Run with required environment variables:
docker run -e MINIO_ENDPOINT=your-minio-server \ -e MINIO_ACCESS_KEY=your-access-key \ -e MINIO_SECRET_KEY=your-secret-key \ minio-init
The role behavior can be customized through Ansible variables. Create an inventory directory or file and mount it when running the container.
# ./config/inventory.ini
[minio]
localhost ansible_connection=local
# ./config/host_vars/minio.yml
minio_users:
- name: service1
access_key: access1
secret_key: secret1
minio_buckets:
- name: data-bucket
access: private
Then run with your config:
docker run -v $(pwd)/config:/config \
-e MINIO_ENDPOINT=your-minio-server \
-e MINIO_ACCESS_KEY=your-access-key \
-e MINIO_SECRET_KEY=your-secret-key \
minio-init --inventory /config/inventory.ini
Variable | Description | Required |
---|---|---|
MINIO_ENDPOINT | MinIO server address | Yes |
MINIO_ACCESS_KEY | Admin access key | Yes |
MINIO_SECRET_KEY | Admin secret key | Yes |
To run the playbook with the test configuration:
docker compose -f docker-compose.test.yml up sut --build
Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.