add static stack
start using remote docker hosts to deploy
This commit is contained in:
parent
f7fa131fd8
commit
57d66c8afa
4 changed files with 36 additions and 0 deletions
4
ansible/README.md
Normal file
4
ansible/README.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# shoarma ansible
|
||||||
|
|
||||||
|
This requires a rootless docker daemon on the Ansible host.
|
||||||
|
See: https://docs.docker.com/engine/security/rootless/
|
|
@ -17,3 +17,4 @@
|
||||||
- {role: shephard, tags: shephard}
|
- {role: shephard, tags: shephard}
|
||||||
- {role: jitsi, tags: jitsi}
|
- {role: jitsi, tags: jitsi}
|
||||||
- {role: pihole, tags: pihole}
|
- {role: pihole, tags: pihole}
|
||||||
|
- {role: static, tags: static}
|
||||||
|
|
23
ansible/roles/static/docker-stack.yml.j2
Normal file
23
ansible/roles/static/docker-stack.yml.j2
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# vi: ft=yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
static:
|
||||||
|
image: git.pim.kunis.nl/pim/concourse-test:latest
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
deploy:
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- "node.labels.public == true"
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.static.entrypoints=websecure
|
||||||
|
- traefik.http.services.static.loadbalancer.server.port=80
|
||||||
|
- traefik.http.routers.static.rule=Host(`pim.kunis.nl`)
|
||||||
|
- traefik.http.routers.static.tls=true
|
||||||
|
- traefik.http.routers.static.tls.certresolver=letsencrypt
|
8
ansible/roles/static/tasks/main.yml
Normal file
8
ansible/roles/static/tasks/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
- name: Deploy Docker stack
|
||||||
|
docker_stack:
|
||||||
|
name: static
|
||||||
|
compose:
|
||||||
|
- "{{ lookup('template', '{{ role_path }}/docker-stack.yml.j2') | from_yaml }}"
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: ssh://root@maestro.dmz
|
||||||
|
delegate_to: localhost
|
Reference in a new issue