ansible-role-shinyproxy/tasks/shinyproxy_docker_service.yml

28 lines
1.1 KiB
YAML

---
- name: Manage the composition of shinyproxy as a docker swarm service
block:
- name: Create the directory where the dockerfile and the configuration file will be copied to
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: Create the docker network used by shinyproxy
docker_network:
name: '{{ shinyproxy_docker_network }}'
driver: overlay
state: present
- 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
tags: [ 'shinyproxy', 'shinyproxy_docker', 'docker' ]