library/roles/smartgears/home_library: Convert to maven_artifact.

This commit is contained in:
Andrea Dell'Amico 2017-06-23 13:39:30 +02:00
parent dcc5c2b1c3
commit 44e66626cf
2 changed files with 34 additions and 18 deletions

View File

@ -1,8 +1,9 @@
---
home_library_gcube_repository: 'gcube-staging'
home_library_install: False
home_library_ver: 1.7.0-4.3.0-144852
home_library_name: home-library-webapp
home_library_filename: '{{ home_library_name }}-{{ home_library_ver }}.war'
home_library_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ home_library_gcube_repository }}/org/gcube/data/access/{{ home_library_name }}/{{ home_library_ver}}/{{ home_library_filename }}'
home_library_war_file: '{{ home_library_name }}.war'
home_library_upgrade: False
home_library_version: 1.8.0-4.6.0-149356
home_library_name: home-library-webapp
home_library_group_id: org.gcube.data.access
home_library_extension: war
home_library_file: '{{ home_library_name }}-{{ home_library_version }}.{{ home_library_extension }}'

View File

@ -1,22 +1,37 @@
---
- block:
- name: Remove the installed HOME LIBRARY connector before upgrading
- name: Remove the installed home library connector before upgrading
file: dest={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/home-library-webapp'
- '{{ smartgears_instance_path }}/webapps/home-library-webapp.war'
when: smartgears_upgrade
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}.war'
when: home_library_upgrade
- name: Get the HOME LIBRARY connector war file
get_url: url={{ home_library_url }} dest={{ smartgears_instance_path }}/webapps/{{ home_library_war_file }}
- maven_artifact: artifact_id={{ home_library_name }} version={{ home_library_version | default(omit) }} group_id={{ home_library_group_id }} extension={{ home_library_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ home_library_file }}
- name: Create the home library working directory
file: path={{ smartgears_instance_path }}/webapps/{{ home_library_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Unarchive the home library war
unarchive: copy=no src={{ smartgears_user_home }}/{{ home_library_file }} dest={{ smartgears_instance_path }}/webapps/{{ home_library_name }}
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}/WEB-INF/lib'
notify: Restart smartgears
# - name: Unpack the HOME LIBRARY connector war file
# shell: mkdir {{ smartgears_instance_path }}/webapps/home-library-webapp ; cd {{ smartgears_instance_path }}/webapps/home-library-webapp ; jar xf {{ smartgears_instance_path }}/webapps/{{ home_library_war_file }}
# args:
# creates: '{{ smartgears_instance_path }}/webapps/home-library-webapp/WEB-INF/web.xml'
become: True
become_user: '{{ smartgears_user }}'
when: home_library_install
tags: [ 'smartgears', 'home_library', 'tomcat' ]
- block:
- name: Remove the installed home library whe we do not want it installed
file: dest={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}.war'
become: True
become_user: '{{ smartgears_user }}'
when: not home_library_install
tags: [ 'smartgears', 'home_library', 'tomcat' ]