library/roles/smartgears/tabular_data: Fix the task that manages the tabulardata upgrade.

d4science-ghn-cluster/smartgears-node-upgrade.yml: Add tabulardata_upgrade: True to the variables list.
This commit is contained in:
Andrea Dell'Amico 2017-02-28 15:20:57 +01:00
parent 14ec0b9e99
commit b9e52a6ab5
2 changed files with 13 additions and 7 deletions

View File

@ -1,10 +1,11 @@
--- ---
gcube_repository: gcube-staging gcube_repository: gcube-staging
tabular_data_install: False tabular_data_install: False
tabular_data_upgrade: False
tabular_data_version: latest tabular_data_version: latest
tabular_data_name: tabular-data-manager tabular_data_name: tabular-data-manager
tabular_group_id: org.gcube.resource.management tabular_group_id: org.gcube.data.analysis.tabulardata
tabular_extension: war tabular_extension: war
tabular_data_file: '{{ tabular_data_name }}-{{ tabular_data_version }}.{{ tabular_extension }}' 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_service_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}'

View File

@ -1,25 +1,30 @@
--- ---
- block: - block:
- name: Remove the old tabulardata files - name: Remove the old tabulardata files
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent
when: ( tabular_data_install ) or ( smartgears_upgrade ) when: tabular_data_upgrade
# NOTE: Install as the smartgears user so we do not mess with the permissions # NOTE: Install as the smartgears user so we do not mess with the permissions
- name: Get the tabular-data-service - 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(omit) }} group_id={{ tabular_group_id }} extension={{ tabular_extension | default('war') }} repository_url={{ tabular_service_repository_url }} dest={{ smartgears_user_home }}/{{ tabular_data_file }}
when: tabular_data_install
- name: Create the tabular data working directory - name: Create the tabular data working directory
file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
when: tabular_data_install
- name: Unarchive the tabular data war - 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 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
when: tabular_data_install
notify: Restart smartgears notify: Restart smartgears
become: True become: True
become_user: '{{ d4science_user }}' become_user: '{{ d4science_user }}'
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' ] tags: [ 'smartgears', 'tabular_data', 'tomcat' ]