From 4920fb847366b621baaf9db00ef1827fd9e59d74 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 25 Sep 2019 03:14:47 +0200 Subject: [PATCH] shinyproxy: Fix the configuration to correctly set the container backend. --- library/roles/shinyproxy/defaults/main.yml | 2 ++ library/roles/shinyproxy/tasks/main.yml | 20 ++++--------------- .../templates/shinyproxy-2-conf.yml.j2 | 3 ++- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/library/roles/shinyproxy/defaults/main.yml b/library/roles/shinyproxy/defaults/main.yml index f5f9fe0..daa4ca5 100644 --- a/library/roles/shinyproxy/defaults/main.yml +++ b/library/roles/shinyproxy/defaults/main.yml @@ -21,6 +21,8 @@ shinyproxy_default_apps: True shinyproxy_container_backend: 'docker' shinyproxy_docker_port: 2375 shinyproxy_docker_host: 'localhost' +shinyproxy_docker_workers: + - 'localhost' shinyproxy_docker_protocol: http shinyproxy_docker_certs_dir: /etc/pki/shinyproxy shinyproxy_docker_url: '{{ shinyproxy_docker_protocol }}://{{ shinyproxy_docker_host }}:{{ shinyproxy_docker_port }}' diff --git a/library/roles/shinyproxy/tasks/main.yml b/library/roles/shinyproxy/tasks/main.yml index 91841e6..96bcefd 100644 --- a/library/roles/shinyproxy/tasks/main.yml +++ b/library/roles/shinyproxy/tasks/main.yml @@ -95,6 +95,10 @@ cron: name="Fix the docker certificates for shinyproxy" special_time=hourly job="/usr/local/bin/sync_docker_certificates > /var/log/shinyproxy/docker_certs.log 2>&1" when: certs_dir.stat.isdir is defined and certs_dir.stat.isdir | bool + - name: Remove the cron job that hourly updates the certificates if we have no local docker + cron: name="Fix the docker certificates for shinyproxy" special_time=hourly job="/usr/local/bin/sync_docker_certificates > /var/log/shinyproxy/docker_certs.log 2>&1" state=absent + when: certs_dir.stat.isdir is not defined or not certs_dir.stat.isdir | bool + - name: Pull the Docker images for the Shiny apps, when using Docker standalone docker_image: name={{ item.docker_image }} pull=yes state={{ item.image_state | default('present') }} force=yes with_items: '{{ shinyproxy_apps }}' @@ -103,22 +107,6 @@ - shinyproxy_container_backend == 'docker' tags: [ 'shinyproxy', 'shinyproxy_images' ] - # - name: Pull the Docker images for the Shiny apps, when using Docker Swarm - # docker_swarm_service: - # name: "{{ item.docker_image | lower }}" - # image: '{{ item.docker_image }}' - # state: "{{ item.image_state | default('present') }}" - # force_update: yes - # reservations: - # cpus: '{{ shinyproxy_docker_cpu_limit }}' - # memory: '{{ shinyproxy_docker_memory_limit }}' - # with_items: '{{ shinyproxy_apps }}' - # delegate_to: '{{ shinyproxy_docker_host }}' - # when: - # - shinyproxy_apps is defined - # - shinyproxy_container_backend == 'docker-swarm' - # tags: [ 'shinyproxy', 'shinyproxy_images' ] - when: shinyproxy_install | bool tags: shinyproxy diff --git a/library/roles/shinyproxy/templates/shinyproxy-2-conf.yml.j2 b/library/roles/shinyproxy/templates/shinyproxy-2-conf.yml.j2 index 8bde1de..fedeb48 100644 --- a/library/roles/shinyproxy/templates/shinyproxy-2-conf.yml.j2 +++ b/library/roles/shinyproxy/templates/shinyproxy-2-conf.yml.j2 @@ -13,6 +13,7 @@ proxy: {% endif %} authentication: {{ shinyproxy_authentication }} admin-groups: {{ shinyproxy_admin_group }} + container-backend: {{ shinyproxy_container_backend }} {% if shinyproxy_ldap_enabled %} # LDAP configuration ldap: @@ -32,12 +33,12 @@ proxy: manager-password: {{ shinyproxy_ldap_admin_pwd }} {% endif %} docker: - container-backend: {{ shinyproxy_container_backend }} container-memory-request: {{ shinyproxy_docker_memory_request }} container-memory-limit: {{ shinyproxy_docker_memory_limit }} container-cpu-limit: {{ shinyproxy_docker_cpu_limit }} cert-path: {{ shinyproxy_docker_certs_dir }} url: {{ shinyproxy_docker_url }} + container-protocol: {{ shinyproxy_docker_protocol }} port-range-start: {{ shinyproxy_docker_port_range_start }} specs: {% if shinyproxy_default_apps %}