Bootstrap minio

This commit is contained in:
Luke Murphy
2020-03-26 11:37:18 +01:00
commit a42aff635d
12 changed files with 175 additions and 0 deletions

5
ansible/.vault.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eu -o pipefail
echo $(pass show hosts/autonomic-dokku/vault/password)

46
ansible/post-deploy.yml Normal file
View File

@ -0,0 +1,46 @@
---
- hosts: all
gather_facts: false
tasks:
- name: Load variables
include_vars:
dir: "{{ dokku_lib_root }}/data/ansible/minio/vars/"
extensions:
- yml
- name: Set HTTP 80 port proxy
dokku_ports:
app: minio
mappings:
- "http:80:{{ http_port }}"
state: present
- name: Setup LE certificates
shell: dokku letsencrypt minio
args:
creates: /home/dokku/minio/letsencrypt/certs
- name: Setup LE certificates renew cron job
shell: dokku letsencrypt:cron-job --add
args:
creates: /home/dokku/minio/letsencrypt/cron-job
- name: Specify certificate docker volume mounts
dokku_storage:
app: keycloak
mounts:
- /home/dokku/minio/letsencrypt/certs:/root/.minio/certs
- name: Remove automatically configured ports
dokku_ports:
app: minio
mappings:
- "http:{{ http_port }}:{{ http_port }}"
state: absent
- name: Set HTTP 443 port
dokku_ports:
app: minio
mappings:
- "https:443:{{ http_port }}"
state: present

41
ansible/pre-deploy.yml Normal file
View File

@ -0,0 +1,41 @@
---
- hosts: all
gather_facts: false
tasks:
- name: Load variables
include_vars:
dir: "{{ dokku_lib_root }}/data/ansible/minio/vars/"
extensions:
- yml
- name: "Configure {{ domain }} domain"
dokku_domains:
app: minio
domains:
- "{{ domain }}"
state: present
- name: Create application directories
file:
path: "{{ item }}"
state: directory
owner: git
group: git
with_items:
- /var/lib/minio
become: true
- name: Specify docker volume mount
dokku_storage:
app: minio
mounts:
- /var/run/minio:/data
- name: Configure the app environment
dokku_config:
app: minio
restart: false
config:
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
MINIO_ACCESS_KEY: "{{ minio_access_key }}"
MINIO_SECRET_KEY: "{{ minio_secret_key }}"

3
ansible/requirements.yml Normal file
View File

@ -0,0 +1,3 @@
---
- src: dokku_bot.ansible_dokku
version: v2020.3.15

4
ansible/vars/all.yml Normal file
View File

@ -0,0 +1,4 @@
---
domain: "minio.autonomic.zone"
autonomic_admin_mail: "helo@autonomic.zone"
http_port: "9000"