2024-04-08 18:28:36 +02:00
|
|
|
---
|
|
|
|
- name: shinyproxy_docker_stack_service | Manage the installation of the shinyproxy configuration of the swarm service
|
|
|
|
tags: ['shinyproxy', 'shinyproxy_swarm', 'docker']
|
|
|
|
block:
|
|
|
|
- name: shinyproxy_docker_stack_service | Create the directory where the dockerfile and the configuration file will be copied into
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: "{{ shinyproxy_as_docker_src_dir }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0700"
|
|
|
|
|
|
|
|
- name: shinyproxy_docker_stack_service | Manage the docker stack
|
|
|
|
tags: ['shinyproxy', 'shinyproxy_swarm', 'docker']
|
|
|
|
run_once: true
|
|
|
|
block:
|
|
|
|
- name: shinyproxy_docker_stack_service | Create the directory where the dockerfile and the configuration file will be copied into
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: "{{ shinyproxy_as_docker_src_dir }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0700"
|
|
|
|
|
|
|
|
- name: shinyproxy_docker_stack_service | Install the docker compose file
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: shinyproxy-docker-compose.yml.j2
|
|
|
|
dest: "{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0400"
|
|
|
|
|
|
|
|
- name: shinyproxy_docker_stack_service | Install the shinyproxy configuration file
|
|
|
|
ansible.builtin.template:
|
2024-04-09 13:18:04 +02:00
|
|
|
src: shinyproxy-conf.yml.j2
|
2024-04-08 18:28:36 +02:00
|
|
|
dest: "{{ shinyproxy_as_docker_src_dir }}/application.yml"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0400"
|
2024-04-09 15:00:33 +02:00
|
|
|
register: shinyproxy_conf_file
|
2024-04-08 18:28:36 +02:00
|
|
|
|
2024-04-09 15:54:52 +02:00
|
|
|
- name: shinyproxy_docker_stack_service | Stop the shinyproxy service {{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }} # noqa: name[template] noqa: yaml[line-length]
|
2024-04-09 15:00:33 +02:00
|
|
|
community.docker.docker_swarm_service:
|
|
|
|
name: "{{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }}"
|
|
|
|
state: absent
|
|
|
|
when: shinyproxy_conf_file is changed # noqa: no-handler
|
|
|
|
|
|
|
|
- name: shinyproxy_docker_stack_service | Create the secret for the application.yml file
|
|
|
|
community.docker.docker_secret:
|
2024-04-09 15:42:19 +02:00
|
|
|
name: "{{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }}"
|
2024-04-09 15:00:33 +02:00
|
|
|
data_src: '{{ shinyproxy_as_docker_src_dir }}/application.yml'
|
|
|
|
state: present
|
|
|
|
when: shinyproxy_conf_file is changed # noqa: no-handler
|
2024-04-08 18:28:36 +02:00
|
|
|
|
|
|
|
- name: shinyproxy_docker_stack_service | Start the shinyproxy stack
|
|
|
|
community.docker.docker_stack:
|
|
|
|
name: '{{ shinyproxy_as_docker_stack_name }}'
|
|
|
|
state: present
|
|
|
|
compose:
|
|
|
|
- '{{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml'
|