From fb99dba4547aeabcd5f6553a2b5cb1284919ef54 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 14 Sep 2017 17:23:51 +0200 Subject: [PATCH] Add a role to manage the sis-geotk-plugin (data transfer). --- .../sis_geotk_dt_plugin/defaults/main.yml | 11 ++++++++++ smartgears/sis_geotk_dt_plugin/tasks/main.yml | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 smartgears/sis_geotk_dt_plugin/defaults/main.yml create mode 100644 smartgears/sis_geotk_dt_plugin/tasks/main.yml diff --git a/smartgears/sis_geotk_dt_plugin/defaults/main.yml b/smartgears/sis_geotk_dt_plugin/defaults/main.yml new file mode 100644 index 0000000..7b066e2 --- /dev/null +++ b/smartgears/sis_geotk_dt_plugin/defaults/main.yml @@ -0,0 +1,11 @@ +--- +sis_geotk_dt_plugin_install: False +sis_geotk_dt_plugin_name: sis-geotk-plugin + +sis_geotk_dt_plugin_group_id : org.gcube.data.transfer +sis_geotk_dt_plugin_artifact_id : '{{ sis_geotk_dt_plugin_name }}' +sis_geotk_dt_plugin_version : latest +sis_geotk_dt_plugin_extension: jar +sis_geotk_dt_plugin_classifier: jar-with-dependencies +sis_geotk_dt_plugin_file: '{{ sis_geotk_dt_plugin_name }}-{{ sis_geotk_dt_plugin_version }}-jar-with-dependencies.{{ sis_geotk_dt_plugin_extension }}' + diff --git a/smartgears/sis_geotk_dt_plugin/tasks/main.yml b/smartgears/sis_geotk_dt_plugin/tasks/main.yml new file mode 100644 index 0000000..73168bb --- /dev/null +++ b/smartgears/sis_geotk_dt_plugin/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- block: + - name: Get the Sis geotk data transfer plugin and install it inside the smart executor + maven_artifact: artifact_id={{ sis_geotk_dt_plugin_name }} version={{ sis_geotk_dt_plugin_version | default(omit) }} group_id={{ sis_geotk_dt_plugin_group_id }} extension={{ sis_geotk_dt_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ sis_geotk_dt_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ sis_geotk_dt_plugin_file }} + register: sis_geotk_download + + - name: Remove the old Sis geotk data transfer plugin + shell: rm -f {{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/{{ sis_geotk_dt_plugin_name }}-*-jar-with-dependencies.jar + when: (sis_geotk_download | changed) + tags: [ 'smartgears', 'sis_geotk', 'tomcat' ] + + - name: Copy the Sis geotk data transfer plugin to its final destination + copy: src={{ smartgears_downloads_dir }}/{{ sis_geotk_dt_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ sis_geotk_dt_plugin_file }} remote_src=yes force=yes + notify: Restart smartgears + + become: True + become_user: '{{ smartgears_user }}' + when: sis_geotk_dt_plugin_install + tags: [ 'smartgears', 'sis_geotk', 'tomcat' ] +