library/roles/smartgears/catalogue_ws: role to install the catalogue ws service.

This commit is contained in:
Andrea Dell'Amico 2017-05-05 13:07:03 +02:00
parent 325efe76a3
commit 8a8005a484
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,10 @@
---
catalogue_ws_install: False
catalogue_ws_upgrade: False
catalogue_ws_version: latest
catalogue_ws_name: catalogue-ws
catalogue_ws_group_id: org.gcube.data-catalogue
catalogue_ws_extension: war
catalogue_ws_file: '{{ catalogue_ws_name }}-{{ catalogue_ws_version }}.{{ catalogue_ws_extension }}'

View File

@ -0,0 +1,30 @@
---
- block:
- name: Remove the old catalogue ws files
file: path={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} state=absent
when: catalogue_ws_upgrade
# NOTE: Install as the smartgears user so we do not mess with the permissions
- name: Get the catalogue-ws
maven_artifact: artifact_id={{ catalogue_ws_name }} version={{ catalogue_ws_version | default(omit) }} group_id={{ catalogue_ws_group_id }} extension={{ catalogue_ws_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ catalogue_ws_file }}
- name: Create the catalogue ws working directory
file: path={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Unarchive the catalogue ws war
unarchive: copy=no src={{ smartgears_user_home }}/{{ catalogue_ws_file }} dest={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} creates={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }}/WEB-INF/lib
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: catalogue_ws_install
tags: [ 'smartgears', 'catalogue_ws', 'tomcat' ]
- block:
- name: Remove the old catalogue ws files
file: path={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} state=absent
become: True
become_user: '{{ d4science_user }}'
when: not catalogue_ws_install
tags: [ 'smartgears', 'catalogue_ws', 'tomcat' ]