ansible-role-shinyproxy/tasks/shinyproxy_docker_service.yml

57 lines
2.4 KiB
YAML
Raw Normal View History

2020-09-23 16:40:51 +02:00
---
- name: Manage the composition of shinyproxy as a docker (non swarm) service
2020-09-23 16:40:51 +02:00
block:
- name: Create the directory where the dockerfile and the configuration file will be copied into
2020-09-23 16:40:51 +02:00
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
- name: Install the shinyproxy configuration file when using version 2.x
template: src=shinyproxy-2-conf.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/application.yml owner=root group=root mode=0400
- name: Install the shinyproxy docker file
template: src=Dockerfile.j2 dest={{ shinyproxy_as_docker_src_dir }}/Dockerfile owner=root group=root mode=0444
- name: Install the docker compose file
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-compose.yml
- name: Run the docker compose file to start the service
docker_compose:
project_src: '{{ shinyproxy_as_docker_src_dir }}'
build: yes
when: shinyproxy_container_backend == 'docker'
2020-09-23 16:40:51 +02:00
tags: [ 'shinyproxy', 'shinyproxy_docker', 'docker' ]
2020-10-07 19:23:09 +02:00
- name: Manage the installation of the shinyproxy configuration of the swarm service
block:
- name: Create the directory where the dockerfile and the configuration file will be copied into
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
- 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'
- shinyproxy_docker_mount_conf_file
tags: [ 'shinyproxy', 'shinyproxy_swarm', 'docker' ]
- name: Manage the docker stack
block:
- name: Create the directory where the dockerfile and the configuration file will be copied into
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
- name: Install the docker compose file
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml
- name: Start the shinyproxy stack
docker_stack:
2021-04-13 19:57:26 +02:00
name: '{{ shinyproxy_as_docker_stack_name }}'
state: present
compose:
2020-10-07 18:48:42 +02:00
- '{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml'
2020-11-09 19:00:50 +01:00
run_once: True
when:
- docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
- shinyproxy_container_backend == 'docker-swarm'
tags: [ 'shinyproxy', 'shinyproxy_swarm', 'docker' ]