mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-26 02:05:05 +00:00
Add Minio
This commit is contained in:
parent
f6b76424f1
commit
bf4d7f9cb4
9 changed files with 139 additions and 0 deletions
|
@ -57,6 +57,7 @@ If you have a spare domain name you can configure applications to be accessible
|
|||
* [Minecraft Server](https://www.minecraft.net/) - Server edition of the popular building and exploring game
|
||||
* [MiniDLNA](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients
|
||||
* [Miniflux](https://miniflux.app/) - An RSS news reader
|
||||
* [Minio](https://min.io/) - MinIO is a high-performance, S3 compatible object store
|
||||
* [Mosquitto](https://mosquitto.org) - An open source MQTT broker
|
||||
* [Mumble](https://www.mumble.info) - Open source, low latency, high quality voice chat
|
||||
* [Mylar](https://github.com/evilhero/mylar) - An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
|
||||
|
|
4
nas.yml
4
nas.yml
|
@ -209,6 +209,10 @@
|
|||
tags:
|
||||
- miniflux
|
||||
|
||||
- role: minio
|
||||
tags:
|
||||
- minio
|
||||
|
||||
- role: mosquitto
|
||||
tags:
|
||||
- mosquitto
|
||||
|
|
25
roles/minio/defaults/main.yml
Normal file
25
roles/minio/defaults/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
# enable or disable the application
|
||||
minio_enabled: false
|
||||
minio_available_externally: false
|
||||
|
||||
# directories
|
||||
minio_data_directory: "{{ docker_home }}/minio"
|
||||
|
||||
# env
|
||||
minio_admin_username: admin
|
||||
minio_admin_password: supersecure
|
||||
|
||||
# network
|
||||
minio_hostname: "minio"
|
||||
minio_network_name: "minio"
|
||||
minio_api_port: "9000"
|
||||
minio_console_port: "9009"
|
||||
|
||||
# docker
|
||||
minio_container_name: "minio"
|
||||
minio_image_name: "minio/minio"
|
||||
minio_image_version: "latest"
|
||||
|
||||
# specs
|
||||
minio_memory: "1g"
|
6
roles/minio/molecule/default/molecule.yml
Normal file
6
roles/minio/molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
provisioner:
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
minio_enabled: true
|
10
roles/minio/molecule/default/side_effect.yml
Normal file
10
roles/minio/molecule/default/side_effect.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Stop
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
|
||||
ansible.builtin.include_role:
|
||||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
||||
vars:
|
||||
minio_enabled: false
|
18
roles/minio/molecule/default/verify.yml
Normal file
18
roles/minio/molecule/default/verify.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- ansible.builtin.include_vars:
|
||||
file: ../../defaults/main.yml
|
||||
|
||||
- name: Get minio container state
|
||||
community.docker.docker_container:
|
||||
name: "{{ minio_container_name }}"
|
||||
register: result
|
||||
|
||||
- name: Check if minio containers are running
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.container['State']['Status'] == "running"
|
||||
- result.container['State']['Restarting'] == false
|
18
roles/minio/molecule/default/verify_stopped.yml
Normal file
18
roles/minio/molecule/default/verify_stopped.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- ansible.builtin.include_vars:
|
||||
file: ../../defaults/main.yml
|
||||
|
||||
- name: Try and stop and remove minio
|
||||
community.docker.docker_container:
|
||||
name: "{{ minio_container_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- name: Check if minio is stopped
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- not result.changed
|
42
roles/minio/tasks/main.yml
Normal file
42
roles/minio/tasks/main.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
- name: Start Minio
|
||||
block:
|
||||
- name: Create Minio Directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ minio_data_directory }}/data"
|
||||
|
||||
|
||||
- name: Create minio Docker Container
|
||||
community.docker.docker_container:
|
||||
name: "{{ minio_container_name }}"
|
||||
image: "{{ minio_image_name }}:{{ minio_image_version }}"
|
||||
pull: true
|
||||
ports:
|
||||
- "{{ minio_api_port }}:9000"
|
||||
- "{{ minio_console_port }}:{{ minio_console_port }}"
|
||||
command: 'server /data --console-address ":{{ minio_console_port }}"'
|
||||
env:
|
||||
MINIO_ROOT_USER: "{{ minio_admin_username }}"
|
||||
MINIO_ROOT_PASSWORD: "{{ minio_admin_password }}"
|
||||
MINIO_PROMETHEUS_AUTH_TYPE: public
|
||||
restart_policy: unless-stopped
|
||||
memory: "{{ minio_memory }}"
|
||||
labels:
|
||||
traefik.enable: "{{ minio_available_externally | string }}"
|
||||
traefik.http.routers.minio.rule: "Host(`{{ minio_hostname }}.{{ ansible_nas_domain }}`)"
|
||||
traefik.http.routers.minio.tls.certresolver: "letsencrypt"
|
||||
traefik.http.routers.minio.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||
traefik.http.routers.minio.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||
traefik.http.services.minio.loadbalancer.server.port: "9000"
|
||||
when: minio_enabled is true
|
||||
|
||||
- name: Stop minio
|
||||
block:
|
||||
- name: Stop minio
|
||||
community.docker.docker_container:
|
||||
name: "{{ minio_container_name }}"
|
||||
state: absent
|
||||
when: minio_enabled is false
|
15
website/docs/applications/system-tools/minio.md
Normal file
15
website/docs/applications/system-tools/minio.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: "Minioo"
|
||||
---
|
||||
|
||||
Homepage: <https://min.io/>
|
||||
|
||||
Docker Container: [Minio](https://hub.docker.com/r/minio/minio)
|
||||
|
||||
MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.
|
||||
|
||||
## Usage
|
||||
|
||||
Set `minio_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
|
||||
|
||||
The Minio web interface can be found at <http://ansible_nas_host_or_ip:9009>.
|
Loading…
Reference in a new issue