Streamline example app variable use

This commit is contained in:
Marty Oehme 2021-08-01 09:52:07 +02:00
parent f7389dc8c3
commit 774f3f7c2e
Signed by: Marty
GPG key ID: B7538B8F50A1C800
4 changed files with 7 additions and 5 deletions

View file

@ -2,6 +2,6 @@
whoami_version: latest whoami_version: latest
whoami_upstream_file_dir: "{{ docker_stack_files_dir }}/whoami" whoami_upstream_file_dir: "{{ docker_stack_files_dir }}/{{ stack.name }}"
whoami_use_https: true whoami_use_https: true

View file

@ -1,7 +1,7 @@
## Register reverse proxy ## Register reverse proxy
# figure out if upstream id exists # figure out if upstream id exists
- name: check whoami upstream - name: check {{ stack.name }} upstream
community.docker.docker_container_exec: community.docker.docker_container_exec:
container: "{{ caddy_container_id }}" container: "{{ caddy_container_id }}"
command: > command: >
@ -12,7 +12,7 @@
listen: "update upstream" listen: "update upstream"
# upstream already exists, patch it # upstream already exists, patch it
- name: remove old whoami upstream - name: remove old {{ stack.name }} upstream
community.docker.docker_container_exec: community.docker.docker_container_exec:
container: "{{ caddy_container_id }}" container: "{{ caddy_container_id }}"
command: > command: >
@ -22,7 +22,7 @@
listen: "update upstream" listen: "update upstream"
# upstream has to be created # upstream has to be created
- name: add whoami upstream - name: add {{ stack.name }} upstream
community.docker.docker_container_exec: community.docker.docker_container_exec:
container: "{{ caddy_container_id }}" container: "{{ caddy_container_id }}"
command: > command: >

View file

@ -2,7 +2,7 @@ version: "3.7"
services: services:
app: app:
image: containous/whoami:{{ whoami_version }} image: {{ stack_image }}:{{ whoami_version }}
networks: networks:
- "{{ docker_swarm_public_network_name }}" - "{{ docker_swarm_public_network_name }}"

View file

@ -1,6 +1,8 @@
--- ---
stack: stack:
name: whoami name: whoami
compose: "{{ lookup('template', 'docker-stack.yml.j2') | from_yaml }}" compose: "{{ lookup('template', 'docker-stack.yml.j2') | from_yaml }}"
stack_image: "containous/whoami"