dataminer: Remove the old algorithms installer when a new distribution has been downloaded from maven.

This commit is contained in:
Andrea Dell'Amico 2017-09-13 16:33:16 +02:00
parent e9e8fa5c7c
commit d1597d1784
2 changed files with 30 additions and 0 deletions

View File

@ -15,6 +15,7 @@ dataminer_wps_extension: war
dataminer_wps_file: '{{ dataminer_wps_name }}-{{ dataminer_wps_version }}.{{ dataminer_wps_extension }}'
# Algorithms installer
dataminer_algorithms_upgrade: False
dataminer_algorithms_version: latest
dataminer_algorithms_gcube_repository: gcube-snapshots
dataminer_algorithms_name: dataminer-algorithms-importer

View File

@ -1,4 +1,27 @@
---
- block:
- name: Remove the old dataminer installation
file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=absent
become: True
become_user: '{{ smartgears_user }}'
when:
- dataminer_app_install
- dataminer_app_upgrade
tags: [ 'tomcat', 'dataminer', 'wps' ]
- block:
- name: Remove the old dataminer algorithm installer
file: path={{ smartgears_user_home }}/algorithmInstaller state=absent
become: True
become_user: '{{ smartgears_user }}'
when:
- dataminer_app_install
- dataminer_algorithms_upgrade
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
- block:
- name: Get and unpack the dataminer application
maven_artifact: artifact_id={{ dataminer_wps_name }} version={{ dataminer_wps_version | default(omit) }} group_id={{ dataminer_wps_group_id }} extension={{ dataminer_wps_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ dataminer_wps_file }}
@ -19,6 +42,12 @@
- name: Get and unpack the algorithms installer
maven_artifact: artifact_id={{ dataminer_algorithms_name }} version={{ dataminer_algorithms_version | default(omit) }} group_id={{ dataminer_algorithms_group_id }} extension={{ dataminer_algorithms_extension | default('war') }} repository_url={{ dataminer_algorithms_base_url }} dest={{ smartgears_user_home }}/{{ dataminer_algorithms_file }}
register: algorithms_installer_downloaded
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
- name: Remove the old dataminer algorithm installer
file: path={{ smartgears_user_home }}/algorithmInstaller state=absent
when: (algorithms_installer_downloaded | changed)
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
- name: Unarchive the algorithms installer