gcube-oauth: Fix the upgrade scenario.

This commit is contained in:
Andrea Dell'Amico 2017-09-25 18:17:06 +02:00
parent e2b6920db9
commit 4859629c1c
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@
with_items: with_items:
- '{{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}' - '{{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}'
- '{{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}.{{ gcube_oauth_extension }}' - '{{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}.{{ gcube_oauth_extension }}'
notify: Restart smartgears
become: True become: True
become_user: '{{ d4science_user }}' become_user: '{{ d4science_user }}'
@ -14,6 +15,12 @@
- block: - block:
- name: Get the gcube-oauth war - name: Get the gcube-oauth war
maven_artifact: artifact_id={{ gcube_oauth_name }} version={{ gcube_oauth_version | default(omit) }} group_id={{ gcube_oauth_group_id }} extension={{ gcube_oauth_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ gcube_oauth_file }} maven_artifact: artifact_id={{ gcube_oauth_name }} version={{ gcube_oauth_version | default(omit) }} group_id={{ gcube_oauth_group_id }} extension={{ gcube_oauth_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ gcube_oauth_file }}
register: gcube_oauth_download
- name: Remove the old gcube oauth files
file: path={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }} state=absent
when: ( gcube_oauth_download | changed )
notify: Restart smartgears
- name: Copy the gcube_oauth war into the webapps directory - name: Copy the gcube_oauth war into the webapps directory
copy: src={{ smartgears_downloads_dir }}/{{ gcube_oauth_file }} dest={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}.{{ gcube_oauth_extension }} remote_src=yes force=yes copy: src={{ smartgears_downloads_dir }}/{{ gcube_oauth_file }} dest={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }}.{{ gcube_oauth_extension }} remote_src=yes force=yes