--- - 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: src: shinyproxy-conf.yml.j2 dest: "{{ shinyproxy_as_docker_src_dir }}/application.yml" owner: root group: root mode: "0400" notify: - Stop the shinyproxy service - Create the secret for the application.yml file - name: shinyproxy_docker_stack_service | Flush the handlers so that we can manage the configuration file as a secret ansible.builtin.meta: flush-handlers - 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'