add swarm dashboard stack
This commit is contained in:
parent
08458532b8
commit
cbd4a06e88
3 changed files with 47 additions and 0 deletions
|
@ -14,3 +14,4 @@
|
|||
- {role: cyberchef, tags: cyberchef}
|
||||
- {role: inbucket, tags: inbucket}
|
||||
- {role: kms, tags: kms}
|
||||
- {role: swarm_dashboard, tags: swarm_dashboard}
|
||||
|
|
31
ansible/roles/swarm_dashboard/docker-stack.yml.j2
Normal file
31
ansible/roles/swarm_dashboard/docker-stack.yml.j2
Normal 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
|
15
ansible/roles/swarm_dashboard/tasks/main.yml
Normal file
15
ansible/roles/swarm_dashboard/tasks/main.yml
Normal 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
|
Reference in a new issue