tabulardata: better use of maven_artifact.

This commit is contained in:
Andrea Dell'Amico 2017-10-19 19:02:44 +02:00
parent 9b0d125d8b
commit b4e9b0b349
2 changed files with 18 additions and 22 deletions

View File

@ -8,8 +8,3 @@ tabular_data_name: tabular-data-manager
tabular_group_id: org.gcube.data.analysis.tabulardata
tabular_extension: war
tabular_data_file: '{{ tabular_data_name }}-{{ tabular_data_version }}.{{ tabular_extension }}'
tabular_service_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}'
#tabular_data_file: '{{ tabular_data_name }}-{{ tabular_data_version }}.war'
#tabular_data_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/data/analysis/tabulardata/{{tabular_data_name}}/{{ tabular_data_version }}/{{ tabular_data_file }}'

View File

@ -1,18 +1,27 @@
---
- block:
- name: Remove the old tabulardata files
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent
when: tabular_data_upgrade
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ tabular_data_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ tabular_data_name }}.{{ tabular_extension }}'
# NOTE: Install as the smartgears user so we do not mess with the permissions
become: True
become_user: '{{ d4science_user }}'
when: not tabular_data_install
tags: [ 'smartgears', 'tabular_data', 'tomcat' ]
- block:
- name: Get the tabular-data-service
maven_artifact: artifact_id={{ tabular_data_name }} version={{ tabular_data_version | default(omit) }} group_id={{ tabular_group_id }} extension={{ tabular_extension | default('war') }} repository_url={{ tabular_service_repository_url }} dest={{ smartgears_user_home }}/{{ tabular_data_file }}
maven_artifact: artifact_id={{ tabular_data_name }} version={{ tabular_data_version | default('latest') }} group_id={{ tabular_group_id }} extension={{ tabular_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ tabular_data_file }}
register: tabular_data_download
- name: Create the tabular data working directory
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Unarchive the tabular data war
unarchive: copy=no src={{ smartgears_user_home }}/{{ tabular_data_file }} dest={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} creates={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }}/WEB-INF/lib
- name: Remove the old tabulardata files
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent
when: ( tabular_data_download | change )
- name: Copy the tabular data war into the webapps directory
copy: src={{ smartgears_downloads_dir }}/{{ tabular_data_file }} dest={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }}.{{ tabular_extension }} remote_src=yes force=yes
notify: Restart smartgears
become: True
@ -20,11 +29,3 @@
when: tabular_data_install
tags: [ 'smartgears', 'tabular_data', 'tomcat' ]
- block:
- name: Remove the old tabulardata files
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent
become: True
become_user: '{{ d4science_user }}'
when: not tabular_data_install
tags: [ 'smartgears', 'tabular_data', 'tomcat' ]