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

Loading…
Cancel
Save