Convert the accounting_insert_storage_se_plugin role to maven_artifact and fix the upgrade scenario.

This commit is contained in:
Andrea Dell'Amico 2017-09-13 18:53:04 +02:00
parent a985775707
commit 99d0a519ff
2 changed files with 20 additions and 15 deletions

View File

@ -2,10 +2,10 @@
accounting_insert_storage_se_plugin_install: False
accounting_insert_storage_se_plugin_upgrade: False
accounting_insert_storage_se_plugin_ver: 1.0.1-4.5.0-148393
accounting_insert_storage_se_plugin_name: '{{ accounting_insert_storage_se_plugin_maven_artifact_id }}-{{ accounting_insert_storage_se_plugin_ver }}-jar-with-dependencies.jar'
accounting_insert_storage_se_plugin_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/accounting/{{ accounting_insert_storage_se_plugin_maven_artifact_id }}/{{ accounting_insert_storage_se_plugin_ver }}/{{ accounting_insert_storage_se_plugin_name }}'
accounting_insert_storage_se_plugin_maven_group_id : 'org.gcube.accounting'
accounting_insert_storage_se_plugin_maven_artifact_id : 'accounting-insert-storage-se-plugin'
accounting_insert_storage_se_plugin_maven_version : '1.0.1-4.5.0-148393'
accounting_insert_storage_se_plugin_name: accounting-insert-storage-se-plugin
accounting_insert_storage_se_plugin_group_id: org.gcube.accounting
accounting_insert_storage_se_plugin_version : 1.0.1-4.5.0-148393
accounting_insert_storage_se_plugin_artifact_id: accounting-insert-storage-se-plugin
accounting_insert_storage_se_plugin_extension: jar
accounting_insert_storage_se_plugin_classifier: jar-with-dependencies
accounting_insert_storage_se_plugin_file: '{{ accounting_insert_storage_se_plugin_name }}-{{ accounting_insert_storage_se_plugin_version }}-{{ accounting_insert_storage_se_plugin_classifier }}.{{ accounting_insert_storage_se_plugin_extension }}'

View File

@ -1,15 +1,20 @@
---
- name: Remove the old accounting insert storage plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_insert_storage_se_plugin_maven_artifact_id }}-*-jar-with-dependencies.jar
when: accounting_insert_storage_se_plugin_upgrade
tags: [ 'smartgears', 'accounting_insert_storage_se', 'tomcat' ]
- block:
- name: Get the accounting insert storage plugin and install it inside the smart executor
maven_artifact: artifact_id={{ accounting_insert_storage_se_plugin_name }} version={{ accounting_insert_storage_se_plugin_version | default(omit) }} group_id={{ accounting_insert_storage_se_plugin_group_id }} extension={{ accounting_insert_storage_se_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_insert_storage_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ accounting_insert_storage_se_plugin_file }}
register: accounting_insert_storage_download
- name: Remove the old accounting insert storage plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_insert_storage_se_plugin_maven_artifact_id }}-*-jar-with-dependencies.jar
when: (accounting_insert_storage_download | changed)
- name: Copy the accounting aggregator plugin to its final destination
copy: src={{ smartgears_downloads_dir }}/{{ accounting_insert_storage_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_insert_storage_se_plugin_file }} remote_src=yes
when: (accounting_insert_storage_download | changed)
notify: Restart smartgears
- name: Get the accounting insert storage plugin and install it inside the smart executor
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ accounting_insert_storage_se_plugin_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: accounting_insert_storage_se_plugin_install
notify: Restart smartgears
when: accounting_insert_storage_se_plugin_install
tags: [ 'smartgears', 'accounting_insert_storage_se', 'tomcat' ]