From 1a096e3b321be0759af51eb0bc05dba6010d1cfa Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 12 Dec 2016 17:28:01 +0100 Subject: [PATCH] library/roles/gcube/grsf_publisher_ws: New role that installs the GRSF publisher. --- gcube/grsf_publisher_ws/defaults/main.yml | 11 +++++++++++ gcube/grsf_publisher_ws/handlers/main.yml | 3 +++ gcube/grsf_publisher_ws/tasks/main.yml | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 gcube/grsf_publisher_ws/defaults/main.yml create mode 100644 gcube/grsf_publisher_ws/handlers/main.yml create mode 100644 gcube/grsf_publisher_ws/tasks/main.yml diff --git a/gcube/grsf_publisher_ws/defaults/main.yml b/gcube/grsf_publisher_ws/defaults/main.yml new file mode 100644 index 00000000..07d9e2a5 --- /dev/null +++ b/gcube/grsf_publisher_ws/defaults/main.yml @@ -0,0 +1,11 @@ +--- +grsf_publisher_ws_install: False +grsf_publisher_ws_upgrade: False +grsf_publisher_ws_gcube_repository: gcube-staging +grsf_publisher_ws_ver: 1.0.0-4.2.0-139879 + +grsf_publisher_ws_name: grsf-publisher-ws +grsf_publisher_ws_file: '{{ grsf_publisher_ws_name }}-{{ grsf_publisher_ws_ver }}.war' + +grsf_publisher_ws_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ grsf_publisher_ws_gcube_repository }}/org/gcube/data-catalogue/{{grsf_publisher_ws_name}}/{{ grsf_publisher_ws_ver }}/{{ grsf_publisher_ws_file }}' + diff --git a/gcube/grsf_publisher_ws/handlers/main.yml b/gcube/grsf_publisher_ws/handlers/main.yml new file mode 100644 index 00000000..a9b4ffdd --- /dev/null +++ b/gcube/grsf_publisher_ws/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Restart smartgears + service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted diff --git a/gcube/grsf_publisher_ws/tasks/main.yml b/gcube/grsf_publisher_ws/tasks/main.yml new file mode 100644 index 00000000..073a3972 --- /dev/null +++ b/gcube/grsf_publisher_ws/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- block: + - name: Remove the old grsf-publisher-ws files + file: path={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }} state=absent + when: grsf_publisher_ws_upgrade + + - name: Create the grsf-publisher-ws working directory + file: path={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} + + - name: Unarchive the grsf_publisher_ws war + unarchive: copy=no src={{ grsf_publisher_ws_url }} dest={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }} creates={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }}/WEB-INF/lib + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'grsf_publisher_ws', 'tomcat' ] + when: grsf_publisher_ws_install