Use the configs option.

This commit is contained in:
Andrea Dell'Amico 2020-11-09 19:00:50 +01:00
parent 27aea17ad6
commit d14a1fbd2c
2 changed files with 8 additions and 6 deletions

View File

@ -29,11 +29,6 @@
- name: Install the shinyproxy configuration file
template: src=shinyproxy-2-conf.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/application.yml owner=root group=root mode=0400
when: shinyproxy_container_backend == 'docker-swarm'
tags: [ 'shinyproxy', 'shinyproxy_swarm', 'docker' ]
- name: Manage the composition of shinyproxy as a docker swarm stack
block:
- name: Install the docker compose file
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml
@ -44,6 +39,7 @@
compose:
- '{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml'
run_once: True
when:
- docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
- shinyproxy_container_backend == 'docker-swarm'

View File

@ -7,6 +7,9 @@ networks:
{% endif %}
{{ shinyproxy_docker_network }}:
configs:
shinyproxy_conf:
file: {{ shinyproxy_as_docker_src_dir }}/application.yml
services:
shinyproxy:
{% if shinyproxy_container_backend == 'docker' %}
@ -18,7 +21,10 @@ services:
{% endif %}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- {{ shinyproxy_as_docker_src_dir }}/application.yml:/opt/shinyproxy/application.yml:ro
configs:
- source: shinyproxy_conf
target: /opt/shinyproxy/application.yml
mode: 0400
networks:
- {{ shinyproxy_docker_network }}
{% if shinyproxy_container_backend == 'docker-swarm' %}