Role that installs the perform-service app.

This commit is contained in:
Andrea Dell'Amico 2019-01-15 17:44:57 +01:00
parent 9f41c8485a
commit 81e7811be5
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
perform_service_install: False
perform_service_version: latest
smartgears_webapp_name: perform-service
perform_service_name: '{{ smartgears_webapp_name }}'
perform_group_id: org.gcube.application
perform_extension: war
perform_service_file: '{{ perform_service_name }}-{{ perform_service_version }}.{{ perform_extension }}'

View File

@ -0,0 +1,31 @@
---
- block:
- name: Remove the old perform files
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ perform_service_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ perform_service_name }}.{{ perform_extension }}'
become: True
become_user: '{{ d4science_user }}'
when: not perform_service_install
tags: [ 'smartgears', 'perform_service', 'tomcat' ]
- block:
- name: Get the perform-service
maven_artifact: artifact_id={{ perform_service_name }} version={{ perform_service_version | default('latest') }} group_id={{ perform_group_id }} extension={{ perform_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ perform_service_file }} verify_checksum=always
register: perform_service_download
- name: Remove the old perform files
file: path={{ smartgears_instance_path }}/webapps/{{ perform_service_name }} state=absent
when: perform_service_download is changed
- name: Copy the perform war into the webapps directory
copy: src={{ smartgears_downloads_dir }}/{{ perform_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ perform_service_name }}.{{ perform_extension }} remote_src=yes force=yes
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: perform_service_install
tags: [ 'smartgears', 'perform_service', 'tomcat' ]