add swarm dashboard stack

This commit is contained in:
Pim Kunis 2023-05-03 13:35:22 +02:00
parent 08458532b8
commit cbd4a06e88
3 changed files with 47 additions and 0 deletions

View file

@ -14,3 +14,4 @@
- {role: cyberchef, tags: cyberchef}
- {role: inbucket, tags: inbucket}
- {role: kms, tags: kms}
- {role: swarm_dashboard, tags: swarm_dashboard}

View file

@ -0,0 +1,31 @@
# vi: ft=yaml
version: "3"
networks:
traefik:
external: true
services:
dashboard:
image: charypar/swarm-dashboard
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
environment:
PORT: 80
networks:
- traefik
deploy:
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
- traefik.http.routers.swarm-dashboard.entrypoints=localsecure
- traefik.http.routers.swarm-dashboard.rule=Host(`swarm.pim.kunis.nl`)
- traefik.http.routers.swarm-dashboard.tls=true
- traefik.http.routers.swarm-dashboard.tls.certresolver=letsencrypt
- traefik.http.routers.swarm-dashboard.service=swarm-dashboard
- traefik.http.services.swarm-dashboard.loadbalancer.server.port=80
- traefik.docker.network=traefik

View file

@ -0,0 +1,15 @@
- name: Create working directory
file:
path: /srv/swarm_dashboard
state: directory
- name: Copy Docker stack file
template:
src: "{{ role_path }}/docker-stack.yml.j2"
dest: /srv/swarm_dashboard/docker-stack.yml
- name: Deploy Docker stack
docker_stack:
name: swarm_dashboard
compose:
- /srv/swarm_dashboard/docker-stack.yml