-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6b7642
commit bf4d7f9
Showing
9 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,6 +209,10 @@ | |
tags: | ||
- miniflux | ||
|
||
- role: minio | ||
tags: | ||
- minio | ||
|
||
- role: mosquitto | ||
tags: | ||
- mosquitto | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
minio_enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>. |