[ansible][on-fire-within] minio

pull/28/head
Alpha Chen 5 years ago
parent 7c85f31cc0
commit 29e6e6c77d

@ -0,0 +1,2 @@
docker/minio/minio filter=lfs diff=lfs merge=lfs -text
docker/mc/mc filter=lfs diff=lfs merge=lfs -text

@ -0,0 +1,5 @@
FROM arm32v7/alpine:latest
COPY mc /usr/sbin
ENTRYPOINT [ "mc" ]

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a06054d2ee1b866b6d3265276dc3dca075f82af07685c2152fbe3f3492be2276
size 19679192

@ -1,11 +1,6 @@
FROM armhf/alpine
FROM arm32v7/alpine:latest
RUN apk update && apk upgrade && \
apk add curl
RUN curl --location --remote-name https://dl.min.io/server/minio/release/linux-arm/minio && \
chmod +x minio && \
mv minio /usr/sbin
COPY minio /usr/sbin
EXPOSE 9000
VOLUME /data

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63bb361b869e6b87725f4e20dda202a07dfc93875668f6cbb52bfede61fc8ebe
size 53025034

@ -29,6 +29,7 @@
state: directory
with_items:
- /etc/ddclient
- /etc/minio
- /etc/traefik
- /mnt/mushu/minio
- /mnt/mushu/syncthing
@ -86,32 +87,16 @@
dest: /etc/traefik/traefik.toml
mode: 0600
# TODO This should really go after the docker_compose task, since it
# depends on the network that docker-compose makes. We should create the
# network first so we can do this, and set the services to use that network
# specifically.
- name: Route Home Assistant through Traefik
block:
# - shell: ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -n 1
- shell: docker network inspect on-fire-within_default | jq --raw-output .[0].IPAM.Config[0].Gateway
register: docker_ip_result
- set_fact:
docker_ip: "{{ docker_ip_result.stdout | trim }}"
- copy:
content: |
[http.routers]
[http.routers.hassio]
rule = "Host(`{{ traefik.host_rules.hassio }}`)"
service = "hassio"
[http.routers.hassio.tls]
certResolver = "le"
[http.services]
[http.services.hassio.loadBalancer]
[[http.services.hassio.loadBalancer.servers]]
url = "http://{{ docker_ip }}:8123/"
dest: /etc/traefik/dynamic_conf.toml
mode: 0600
# The docker_compose module overwrites our existing variables, so this is a
# workaround to save off ones that we need later on in the playbook.
#
# https://github.com/ansible/ansible/issues/33960
- name: Save original host facts
set_fact:
"{{ item }}_original": "{{ lookup('vars', item) }}"
with_items:
- minio
- traefik
- name: Docker ALL the things!
docker_compose:
@ -129,12 +114,11 @@
minio:
image: kejadlen/minio:latest
container_name: minio
ports:
- 9000:9000/tcp
environment:
MINIO_ACCESS_KEY: "{{ minio.access_key }}"
MINIO_SECRET_KEY: "{{ minio.secret_key }}"
volumes:
- /etc/minio:/root/.minio
- /mnt/mushu/minio:/data
user: 0:0 # root
labels:
@ -202,6 +186,29 @@
- traefik.http.routers.traefik.service=api@internal
restart: unless-stopped
- name: Route Home Assistant through Traefik
block:
# - shell: ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -n 1
- shell: docker network inspect on-fire-within_default | jq --raw-output .[0].IPAM.Config[0].Gateway
register: docker_ip_result
- set_fact:
docker_ip: "{{ docker_ip_result.stdout | trim }}"
- copy:
content: |
[http.routers]
[http.routers.hassio]
rule = "Host(`{{ traefik_original.host_rules.hassio }}`)"
service = "hassio"
[http.routers.hassio.tls]
certResolver = "le"
[http.services]
[http.services.hassio.loadBalancer]
[[http.services.hassio.loadBalancer.servers]]
url = "http://{{ docker_ip }}:8123/"
dest: /etc/traefik/dynamic_conf.toml
mode: 0600
handlers:
- name: Restart ddclient
docker_container:

Loading…
Cancel
Save