From 14e358c5fe77ffccae565c6ea116192b261026e6 Mon Sep 17 00:00:00 2001 From: Saibotk Date: Mon, 20 Jan 2025 00:25:52 +0100 Subject: [PATCH] remove!(minio): unused --- playbooks/minio.yml | 25 ------ roles/minio/README.md | 57 -------------- roles/minio/defaults/main.yml | 41 ---------- roles/minio/meta/main.yml | 44 ----------- roles/minio/tasks/main.yml | 98 ------------------------ roles/minio/templates/docker-compose.yml | 72 ----------------- 6 files changed, 337 deletions(-) delete mode 100644 playbooks/minio.yml delete mode 100644 roles/minio/README.md delete mode 100644 roles/minio/defaults/main.yml delete mode 100644 roles/minio/meta/main.yml delete mode 100644 roles/minio/tasks/main.yml delete mode 100644 roles/minio/templates/docker-compose.yml diff --git a/playbooks/minio.yml b/playbooks/minio.yml deleted file mode 100644 index 7d8d0e9..0000000 --- a/playbooks/minio.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# Infrastructure -# Ansible instructions to deploy the infrastructure -# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern -# Copyright (C) 2020 Saibotk -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -- name: Install & configure MinIO - hosts: minio - roles: - - docker - - docker_cleanup - - traefik - - minio diff --git a/roles/minio/README.md b/roles/minio/README.md deleted file mode 100644 index 280bff7..0000000 --- a/roles/minio/README.md +++ /dev/null @@ -1,57 +0,0 @@ -Minio -========= - -This role provides an easy to use and extend automated setup of S3 compatible object storage. - -Since minio only support single-tenant per instance, providing one instance per use-case is the way to go. - -It also helps to scale minio in the future. Simply move from group_vars to host vars and distribute your data this way. - -Details about multi-tenant support in minio: -https://docs.minio.io/docs/multi-tenant-minio-deployment-guide.html - -Requirements ------------- - -You will need to have docker, docker-compose and traefik installed or declared as dependencies with their respective roles. - -**This role assumes that you have setup traefik with an endpoint called `websecure`.** - -Role Variables --------------- - -**Please look at the [defaults/main.yml](defaults/main.yml) for all available variables and their description.** - -**Note: Lines that are commented out via `#` are usually still valid/used variables, but they are not defined by default, so they might enable a feature, when uncommenting/defining them!** - -### Global variables, that are used: - -- `proxy_network`: Defined by the local traefik installation, this is the shared proxy network used by traefik to reach the containers. (optional) -- `proxy_hiddenservice`: Defined by the local traefik installation, this is used to generate the alt-svc header for the alternative Tor domain. (optional) - -### Example config: - -`group_vars/minio`: - -```yaml ---- -minio_domain: minio.example.com -minio_users: - codimd: - access_key: EXAMPLEgVfvsmjz4KG5tEXAMPLE - secret_key: EXAMPLEPlTMWneuixqzJDjqTAQSjJgLw92CCgTUf2Hkq9QFq6vMVsHel7EXAMPLE - browser: "on" -``` - -Dependencies ------------- - -- docker -- docker-compose -- traefik - -License -------- - -GPL-3.0-only - diff --git a/roles/minio/defaults/main.yml b/roles/minio/defaults/main.yml deleted file mode 100644 index f6ffe4d..0000000 --- a/roles/minio/defaults/main.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Default variables for the minio role - -# Infrastructure -# Ansible instructions to deploy the infrastructure -# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern -# Copyright (C) 2020 Saibotk -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# The install/data volume location -minio_install_location: "/srv/minio" -minio_data_location: "{{ minio_install_location }}/data" - -# The container version/tag -# renovate: depName=docker.io/minio/minio -minio_version: "latest" - -# The domain, under which traefik should serve the minio instances as subdomains -minio_domain: s3.example.com - -# The certresolver traefik should use for the domains -minio_traefik_certresolver: "letsencrypt_http" - -# The minio instances that should be deployed -# Available fields: -# NAME - The instance name eg. mastodon -> will result in the domain `mastodon.s3.example.com` -# access_key - The access key -# secret_key - The secret key -# browser - Optional: Enable/Disable the minio browser -minio_users: [] diff --git a/roles/minio/meta/main.yml b/roles/minio/meta/main.yml deleted file mode 100644 index b721599..0000000 --- a/roles/minio/meta/main.yml +++ /dev/null @@ -1,44 +0,0 @@ -galaxy_info: - author: saibotk - description: "Installs and manages minio instances for S3 compatible storage." - license: GPL-3.0-only - min_ansible_version: "2.9" - standalone: true - - platforms: - - name: EL - versions: - - all - - name: GenericUNIX - versions: - - all - - name: Fedora - versions: - - all - - name: opensuse - versions: - - all - - name: GenericBSD - versions: - - all - - name: FreeBSD - versions: - - all - - name: Ubuntu - versions: - - all - - name: SLES - versions: - - all - - name: GenericLinux - versions: - - all - - name: Debian - versions: - - all - - galaxy_tags: [] - -dependencies: - - role: docker - - role: traefik diff --git a/roles/minio/tasks/main.yml b/roles/minio/tasks/main.yml deleted file mode 100644 index 437005a..0000000 --- a/roles/minio/tasks/main.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -# Tasks file for the minio role - -# Infrastructure -# Ansible instructions to deploy the infrastructure -# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern -# Copyright (C) 2020 Alexander Wellbrock -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -- name: Update default SELinux contexts - community.general.sefcontext: - target: "{{ item }}(/.*)?" - setype: "container_file_t" - state: present - with_items: - - "{{ minio_data_location }}" - tags: - - minio - become: true - -- name: Create install directory - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: "0700" - owner: "root" - group: "root" - with_items: - - "{{ minio_install_location }}" - become: true - tags: - - minio - -- name: Create data directory - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: "0700" - owner: "root" - group: "root" - setype: "container_file_t" - with_items: - - "{{ minio_data_location }}" - become: true - tags: - - minio - -- name: Create minio user directory - ansible.builtin.file: - path: "{{ minio_data_location }}/{{ item.key }}" - state: directory - mode: "0700" - owner: "root" - group: "root" - with_dict: - - "{{ minio_users }}" - tags: - - minio - become: true - no_log: true - -- name: Deploy docker-compose.yml - ansible.builtin.template: - src: docker-compose.yml - dest: "{{ minio_install_location }}/docker-compose.yml" - mode: "0600" - owner: "root" - group: "root" - validate: docker compose -f %s config -q - tags: - - docker - - minio - become: true - when: - - minio_users | length > 0 - -- name: Compose minio - community.docker.docker_compose_v2: - state: present - project_src: "{{ minio_install_location }}" - pull: always - remove_orphans: true - tags: - - minio - become: true - when: - - minio_users | length > 0 diff --git a/roles/minio/templates/docker-compose.yml b/roles/minio/templates/docker-compose.yml deleted file mode 100644 index 4830022..0000000 --- a/roles/minio/templates/docker-compose.yml +++ /dev/null @@ -1,72 +0,0 @@ -{{ ansible_managed | comment }} - -# Infrastructure -# Ansible instructions to deploy the infrastructure -# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -version: '2' -services: -{% for key, value in minio_users.items() %} - - {{ key }}: - image: docker.io/minio/minio:{{ minio_version }} - mem_limit: 256mb - memswap_limit: 512mb - read_only: true - tmpfs: - - /root/.minio:size=128K - environment: - - "MINIO_ROOT_USER={{ value.access_key }}" - - "MINIO_ROOT_PASSWORD={{ value.secret_key }}" - - "MINIO_BROWSER={{ value.browser | default("off") }}" - - "MINIO_DOMAIN={{ key }}.{{ minio_domain }}" - volumes: - - "{{ minio_data_location }}/{{ key }}:/data" - command: ["server", "/data"] - restart: always - labels: - - "traefik.http.routers.minio_{{ key }}.rule=Host(`{{ key }}.{{ minio_domain }}`) && PathPrefix(`/`)" - - "traefik.http.routers.minio_{{ key }}.entrypoints=websecure" - - "traefik.http.routers.minio_{{ key }}.tls=true" - - "traefik.http.routers.minio_{{ key }}.tls.certresolver={{ minio_traefik_certresolver }}" - - "traefik.http.routers.minio_{{ key }}.middlewares=minio_{{ key }},compress" - - "traefik.http.routers.minio_{{ key }}.service=minio_{{ key }}" - - "traefik.http.services.minio_{{ key }}.loadbalancer.server.port=9000" - - "traefik.http.middlewares.minio_{{ key }}.headers.sslredirect=true" - - "traefik.http.middlewares.minio_{{ key }}.headers.stsSeconds=63072000" - - "traefik.http.middlewares.minio_{{ key }}.headers.referrerPolicy=no-referrer" - - "traefik.http.middlewares.minio_{{ key }}.headers.contentTypeNosniff=true" - - "traefik.http.middlewares.minio_{{ key }}.headers.browserXssFilter=true" - - - "traefik.enable=true" -{% if proxy_network is defined %} - - "traefik.docker.network={{ proxy_network }}" -{% endif %} -{% if proxy_hiddenservice is defined and proxy_hiddenservice.content is defined %} - - "traefik.http.middlewares.minio_{{ key }}.headers.customresponseheaders.alt-svc=h2={{ proxy_hiddenservice['content'] | b64decode | trim }}:443; ma=2592000" -{% endif %} - -{% if proxy_network is defined %} - networks: - {{ proxy_network }}: -{% endif %} - -{% endfor %} - -{% if proxy_network is defined %} -networks: - {{ proxy_network }}: - external: true -{% endif %}