From 6d59fd862d09564411eb8dd7df6bcb4c7a0280f6 Mon Sep 17 00:00:00 2001 From: Roberto Date: Thu, 15 Feb 2018 16:22:47 +0100 Subject: [PATCH] group_vars/ckan_bb/ckan_bb.yml added vo scopes group_vars/ckan_sobigdata/ckan_sobigdata.yml added vo scopes group_vars/ckan_web_d4s/ckan_web_d4s.yml added vo scopes inventory/hosts.dev added new host for is_exporter plugin ../library/roles/smartgears/is_exporter_se_plugin new role for uber-jar --- .../is_exporter_se_plugin/defaults/main.yml | 14 ++++-- .../is_exporter_se_plugin/tasks/main.yml | 44 ++++++++++++++----- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/smartgears/is_exporter_se_plugin/defaults/main.yml b/smartgears/is_exporter_se_plugin/defaults/main.yml index 2ea5232..dd65ba2 100644 --- a/smartgears/is_exporter_se_plugin/defaults/main.yml +++ b/smartgears/is_exporter_se_plugin/defaults/main.yml @@ -3,8 +3,14 @@ is_exporter_se_plugin_install: False is_exporter_se_plugin_upgrade: False is_exporter_se_plugin_version: latest -is_exporter_se_plugin_group_id: 'org.gcube.information-system' -is_exporter_se_plugin_name: 'is-exporter-se-plugin' +is_exporter_se_plugin_group_id: 'org.gcube.accounting' +is_exporter_se_plugin_name: 'accounting-aggregator-se-plugin' is_exporter_se_plugin_extension: 'jar' -is_exporter_se_plugin_classifier: 'jar-with-dependencies' -is_exporter_se_plugin_file: '{{ is_exporter_se_plugin_name }}-{{ is_exporter_se_plugin_version }}-jar-with-dependencies.{{ is_exporter_se_plugin_extension }}' +is_exporter_se_plugin_classifier: 'uberjar' +is_exporter_se_plugin_uber_file: '{{ is_exporter_se_plugin_name }}-{{ is_exporter_se_plugin_version }}-{{ is_exporter_se_plugin_classifier }}.{{ is_exporter_se_plugin_extension }}' +is_exporter_se_plugin_file: '{{ is_exporter_se_plugin_name }}-{{ is_exporter_se_plugin_version }}.{{ is_exporter_se_plugin_extension }}' + +catalina_apps_conf: + - { app_name: '{{ smart_executor_name }}', plugin_name: '{{ is_exporter_se_plugin_name }}' } + +# Note: the deb package nco is required diff --git a/smartgears/is_exporter_se_plugin/tasks/main.yml b/smartgears/is_exporter_se_plugin/tasks/main.yml index 75c6272..9dc4560 100644 --- a/smartgears/is_exporter_se_plugin/tasks/main.yml +++ b/smartgears/is_exporter_se_plugin/tasks/main.yml @@ -1,27 +1,49 @@ --- - block: - - name: Remove the old is-exporter plugin - shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ is_exporter_se_plugin_name }}-*-{{ is_exporter_se_plugin_classifier }}.{{ is_exporter_se_plugin_extension }} + - name: Remove the is_exporter smart executor plugin + file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }} state=absent notify: Restart smartgears - + become: True become_user: '{{ smartgears_user }}' when: not is_exporter_se_plugin_install tags: [ 'smartgears', 'is_exporter_se', 'tomcat' ] + - block: - - name: Download the is-exporter plugin - maven_artifact: artifact_id={{ is_exporter_se_plugin_name }} version={{ is_exporter_se_plugin_version | default(omit) }} group_id={{ is_exporter_se_plugin_group_id }} extension={{ is_exporter_se_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ is_exporter_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ is_exporter_se_plugin_file }} - register: is_exporter_plugin_download + - name: Download the is_exporter plugin uber jar + maven_artifact: artifact_id={{ is_exporter_se_plugin_name }} version={{ is_exporter_se_plugin_version | default('latest') }} group_id={{ is_exporter_se_plugin_group_id }} extension={{ is_exporter_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ is_exporter_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ is_exporter_se_plugin_uber_file }} + register: is_exporter_download - - name: Remove the old is-exporter plugin - shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ is_exporter_se_plugin_name }}-*-{{ is_exporter_se_plugin_classifier }}.{{ is_exporter_se_plugin_extension }} - when: ( is_exporter_plugin_download | changed ) + - name: Remove the old is_exporter smart executor plugin + file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }} state=absent + when: ( is_exporter_download | changed ) + notify: Restart smartgears - - name: Install the is-exporter plugin inside the smart executor lib directory - copy: src={{ smartgears_downloads_dir }}/{{ is_exporter_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ is_exporter_se_plugin_file }} remote_src=yes force=yes + - name: Create the plugin directory inside the smart executor + file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }} state=directory + register: is_exporter_create_dir + + - name: Unarchive the is_exporter uber jar to expose its libraries + unarchive: src={{ smartgears_downloads_dir }}/{{ is_exporter_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }}/ copy=no + when: (is_exporter_create_dir | changed) + notify: Restart smartgears + + - name: Download the is_exporter plugin jar file + maven_artifact: artifact_id={{ is_exporter_se_plugin_name }} version={{ is_exporter_se_plugin_version }} group_id={{ is_exporter_se_plugin_group_id }} extension={{ is_exporter_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }} keep_name=yes + notify: Restart smartgears + + - name: Remove the Sis geotk uber jar org and META-INF directories + file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }}/{{ item }} state=absent + with_items: + - org + - 'META-INF' notify: Restart smartgears + - name: Install the nco package + become_user: root + apt: pkg=nco state=present update_cache=yes cache_valid_time=1800 + become: True become_user: '{{ smartgears_user }}' when: is_exporter_se_plugin_install