From 602ed0f8e8a25c4453b483ecb96848bb09c9b4a8 Mon Sep 17 00:00:00 2001 From: Roberto Date: Wed, 1 Mar 2017 14:16:40 +0100 Subject: [PATCH] group_vars/spd_service_pre/spd_pre.yml added spd service group_vars/rstudio_dev/rstudio.yml added smartgears distro version (staging repo) ../library/roles/smartgears/r_connector/defaults/main.yml upgrade r_connector version --- smartgears/r_connector/defaults/main.yml | 2 +- smartgears/spd_service/defaults/main.yml | 11 +++++++++ smartgears/spd_service/handlers/main.yml | 3 +++ smartgears/spd_service/tasks/main.yml | 30 ++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 smartgears/spd_service/defaults/main.yml create mode 100644 smartgears/spd_service/handlers/main.yml create mode 100644 smartgears/spd_service/tasks/main.yml diff --git a/smartgears/r_connector/defaults/main.yml b/smartgears/r_connector/defaults/main.yml index 977aa8f5..23fe51ba 100644 --- a/smartgears/r_connector/defaults/main.yml +++ b/smartgears/r_connector/defaults/main.yml @@ -1,7 +1,7 @@ --- gcube_repository: 'gcube-staging' r_connector_install: False -r_connector_ver: 2.1.1-4.2.1-135146 +r_connector_ver: 2.1.2-4.3.0-144071 r_connector_name: r-connector r_connector_filename: '{{ r_connector_name }}-{{ r_connector_ver }}.war' r_connector_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/data/analysis/{{ r_connector_name }}/{{ r_connector_ver}}/{{ r_connector_filename }}' diff --git a/smartgears/spd_service/defaults/main.yml b/smartgears/spd_service/defaults/main.yml new file mode 100644 index 00000000..5192ba18 --- /dev/null +++ b/smartgears/spd_service/defaults/main.yml @@ -0,0 +1,11 @@ +--- +gcube_repository: gcube-staging +spd_service_install: False +spd_service_upgrade: False +spd_service_version: latest +spd_service_name: species-products-discovery + +spd_group_id: org.gcube.data.spd +spd_extension: war +spd_service_file: '{{ spd_service_name }}-{{ spd_service_version }}.{{ spd_extension }}' +spd_service_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}' diff --git a/smartgears/spd_service/handlers/main.yml b/smartgears/spd_service/handlers/main.yml new file mode 100644 index 00000000..a9b4ffdd --- /dev/null +++ b/smartgears/spd_service/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Restart smartgears + service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted diff --git a/smartgears/spd_service/tasks/main.yml b/smartgears/spd_service/tasks/main.yml new file mode 100644 index 00000000..96e93dc0 --- /dev/null +++ b/smartgears/spd_service/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- block: + - name: Remove the old spd files + file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=absent + when: spd_service_upgrade + + # NOTE: Install as the smartgears user so we do not mess with the permissions + - name: Get the spd-service + maven_artifact: artifact_id={{ spd_service_name }} version={{ spd_service_version | default(omit) }} group_id={{ spd_group_id }} extension={{ spd_extension | default('war') }} repository_url={{ spd_service_repository_url }} dest={{ smartgears_user_home }}/{{ spd_service_file }} + + - name: Create the spd working directory + file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} + + - name: Unarchive the spd war + unarchive: copy=no src={{ smartgears_user_home }}/{{ spd_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ spd_service_name }}/WEB-INF/lib + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + when: spd_service_install + tags: [ 'smartgears', 'spd_service', 'tomcat' ] + +- block: + - name: Remove the old spd files + file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=absent + + become: True + become_user: '{{ d4science_user }}' + when: not spd_service_install + tags: [ 'smartgears', 'spd_service', 'tomcat' ]