accounting-dashboard-harvester-se-plugin role. See https://support.d4science.org/issues/11771

This commit is contained in:
Andrea Dell'Amico 2018-11-30 19:47:52 +01:00
parent 962105f7f5
commit 918d1f161d
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,15 @@
---
accounting_dashboard_harvester_se_plugin_install: False
accounting_dashboard_harvester_se_plugin_upgrade: False
accounting_dashboard_harvester_se_plugin_version: latest
accounting_dashboard_harvester_se_plugin_group_id: 'org.gcube.accounting'
accounting_dashboard_harvester_se_plugin_name: 'accounting-dashboard-harvester-se-plugin'
accounting_dashboard_harvester_se_plugin_extension: 'jar'
accounting_dashboard_harvester_se_plugin_classifier: 'uberjar'
accounting_dashboard_harvester_se_plugin_uber_file: '{{ accounting_dashboard_harvester_se_plugin_name }}-{{ accounting_dashboard_harvester_se_plugin_version }}-{{ accounting_dashboard_harvester_se_plugin_classifier }}.{{ accounting_dashboard_harvester_se_plugin_extension }}'
accounting_dashboard_harvester_se_plugin_file: '{{ accounting_dashboard_harvester_se_plugin_name }}-{{ accounting_dashboard_harvester_se_plugin_version }}.{{ accounting_dashboard_harvester_se_plugin_extension }}'
catalina_apps_conf:
- { app_name: '{{ smart_executor_name }}', plugin_name: '{{ accounting_dashboard_harvester_se_plugin_name }}' }

View File

@ -0,0 +1,46 @@
---
- block:
- name: Remove the accounting_dashboard_harvester smart executor plugin
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }} state=absent
notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'
when: not accounting_dashboard_harvester_se_plugin_install
tags: [ 'smartgears', 'accounting_dashboard_harvester_se', 'tomcat' ]
- block:
- name: Download the accounting_dashboard_harvester plugin uber jar
maven_artifact: artifact_id={{ accounting_dashboard_harvester_se_plugin_name }} version={{ accounting_dashboard_harvester_se_plugin_version | default('latest') }} group_id={{ accounting_dashboard_harvester_se_plugin_group_id }} extension={{ accounting_dashboard_harvester_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_dashboard_harvester_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ accounting_dashboard_harvester_se_plugin_uber_file }}
register: accounting_dashboard_harvester_download
- name: Remove the old accounting_dashboard_harvester smart executor plugin
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }} state=absent
when: accounting_dashboard_harvester_download is changed
notify: Restart smartgears
- name: Create the plugin directory inside the smart executor
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }} state=directory
register: accounting_dashboard_harvester_create_dir
- name: Unarchive the accounting_dashboard_harvester uber jar to expose its libraries
unarchive: src={{ smartgears_downloads_dir }}/{{ accounting_dashboard_harvester_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }}/ copy=no
when: accounting_dashboard_harvester_create_dir is changed
notify: Restart smartgears
- name: Download the accounting_dashboard_harvester plugin jar file
maven_artifact: artifact_id={{ accounting_dashboard_harvester_se_plugin_name }} version={{ accounting_dashboard_harvester_se_plugin_version }} group_id={{ accounting_dashboard_harvester_se_plugin_group_id }} extension={{ accounting_dashboard_harvester_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }} keep_name=yes
notify: Restart smartgears
- name: Remove the accounting_dashboard_harvester uber jar org and META-INF directories
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_dashboard_harvester_se_plugin_name }}/{{ item }} state=absent
with_items:
- org
- 'META-INF'
notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'
when: accounting_dashboard_harvester_se_plugin_install
tags: [ 'smartgears', 'accounting_dashboard_harvester_se', 'tomcat' ]