From 31c6288e857661fbb2854da76cccc08327f580b1 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 21 Jul 2016 17:14:13 +0200 Subject: [PATCH] library/roles/smartgears/r_connector: Install the adduser script, really. library/roles/smartgears/smartgears/templates/container.xml.j2: The VO can be a list. Change the default and the template. --- smartgears/r_connector/tasks/main.yml | 9 ++++++-- smartgears/smartgears/defaults/main.yml | 4 +++- .../smartgears/templates/container.xml.j2 | 22 +++++++++++-------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/smartgears/r_connector/tasks/main.yml b/smartgears/r_connector/tasks/main.yml index 438336d0..00dda471 100644 --- a/smartgears/r_connector/tasks/main.yml +++ b/smartgears/r_connector/tasks/main.yml @@ -9,20 +9,25 @@ when: smartgears_upgrade or not r_connector_install - name: Get the R connector war file - get_url: url={{ ckan_connector_url }} dest={{ smartgears_instance_path }}/webapps/{{ ckan_connector_war_file }} + get_url: url={{ r_connector_url }} dest={{ smartgears_instance_path }}/webapps/{{ r_connector_war_file }} - name: Unpack the R connector war file - shell: mkdir {{ smartgears_instance_path }}/webapps/r-connector ; cd {{ smartgears_instance_path }}/webapps/r-connector ; jar xf {{ smartgears_instance_path }}/webapps/{{ ckan_connector_war_file }} + shell: mkdir {{ smartgears_instance_path }}/webapps/r-connector ; cd {{ smartgears_instance_path }}/webapps/r-connector ; jar xf {{ smartgears_instance_path }}/webapps/{{ r_connector_war_file }} args: creates: '{{ smartgears_instance_path }}/webapps/r-connector/WEB-INF/web.xml' - name: Obtain the permission to read the Rstudio secure cookie key + become: False file: dest={{ r_connector_rstudio_cookie_key }} mode=640 group={{ smartgears_user }} - name: Install the R connector web.xml template template: src=r-web.xml.j2 dest={{ smartgears_instance_path }}/webapps/r-connector/WEB-INF/web.xml mode=0440 notify: Restart smartgears + - name: Install the R add users script + become: False + template: src=rusersadd.j2 dest={{ r_connector_adduserscript }} owner=root group=root mode=0555 + become: True become_user: '{{ smartgears_user }}' when: r_connector_install diff --git a/smartgears/smartgears/defaults/main.yml b/smartgears/smartgears/defaults/main.yml index 90cf1cec..5209b368 100644 --- a/smartgears/smartgears/defaults/main.yml +++ b/smartgears/smartgears/defaults/main.yml @@ -19,10 +19,12 @@ smartgears_distribution_version: 1.2.8-4.0.0-129615 smartgears_file: 'smartgears-distribution-{{ smartgears_distribution_version }}.tar.gz' smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/distribution/smartgears-distribution/{{ smartgears_distribution_version }}/{{ smartgears_file }}' smartgears_mode: online +smartgears_application_mode: online # Production infra and VO smartgears_infrastructure_name: "d4science.research-infrastructures.eu" smartgears_vo: True -smartgears_vo_name: gCubeApps +smartgears_vo_name: + - gCubeApps smartgears_hostname: '{{ ansible_fqdn }}' smartgears_country: it smartgears_location: pisa diff --git a/smartgears/smartgears/templates/container.xml.j2 b/smartgears/smartgears/templates/container.xml.j2 index dd824f60..d49b8f49 100644 --- a/smartgears/smartgears/templates/container.xml.j2 +++ b/smartgears/smartgears/templates/container.xml.j2 @@ -11,9 +11,11 @@ {{ item.http_port }} {% endif %} {{ smartgears_infrastructure_name }} -{% if smartgears_vo %} - {{ smartgears_vo_name }} -{% endif %} + {% if smartgears_vo %} + {% for vo_n in smartgears_vo_name %} + {{ vo_n }} + {% endfor %} + {% endif %} {{ smartgears_country }} @@ -25,13 +27,15 @@ 60 + {% if smartgears_define_context_vo %} - - -{% for context in smartgears_contexts_list %} - /{{ smartgears_infrastructure_name }}/{{ smartgears_vo_name }}{{ context }} -{% endfor %} + + {% for vo_n in smartgears_vo_name %} + {% for context in smartgears_contexts_list %} + /{{ smartgears_infrastructure_name }}/{{ vo_n }}{{ context }} + {% endfor %} + {% endfor %} -{% endif %} +{% endif %}