data-transfer-service: expand the war file after the installation and setup the gcube-app.xml file.

This commit is contained in:
Andrea Dell'Amico 2017-09-19 20:07:24 +02:00
parent 36e95e334c
commit 1e5f6b6e30
5 changed files with 46 additions and 15 deletions

View File

@ -82,6 +82,9 @@ smartgears_debugging_port: '{{ tomcat_m_remote_debugging_port }}'
# tcp:
# - { port: '{{ smartgears_debugging_port }}', allowed_hosts: [ '{{ network.isti }}', '{{ network.nmis }}', '{{ network.eduroam }}' ] }
# This is only used to setup the nginx reverse proxy. The data-trasfer war file is always installed
# This is only used to setup the nginx reverse proxy and the service configuration.
# The data-trasfer war file is always installed
data_transfer_service_install: False
data_trasfer_service_name: data-transfer-service
data_transfer_set_local_persistence: False

View File

@ -0,0 +1,23 @@
---
- name: Create the data transfer webapp directory
become: True
become_user: '{{ smartgears_user }}'
file: path={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }} state=directory
when: data_transfer_service_install
tags: [ 'smartgears', 'smartgears_data_trasfer', 'tomcat' ]
- name: Unarchive the data transfer webapp directory
become: True
become_user: '{{ smartgears_user }}'
unarchive: src={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}.war dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/gcube-app.xml remote_src=yes
when: data_transfer_service_install
tags: [ 'smartgears', 'smartgears_data_trasfer', 'tomcat' ]
- name: Install the gcube-app file used by the data-transfer-service
become: True
become_user: '{{ smartgears_user }}'
template: src=data-transfer-gcube-app.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/gcube-app.xml
when: data_transfer_service_install
notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_data_trasfer', 'tomcat' ]

View File

@ -1,4 +1,6 @@
---
- include: smartgears-app.yml
- include: data-transfer-service.yml
when: data_transfer_service_install
- include: install-gcube-keys.yml

View File

@ -131,20 +131,6 @@
notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]
- name: Create the data transfer webapp directory
become: True
become_user: '{{ smartgears_user }}'
file: path={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }} state=directory
when: data_transfer_service_install
tags: [ 'smartgears', 'smartgears_data_trasfer', 'tomcat' ]
- name: Unarchive the data transfer webapp directory
become: True
become_user: '{{ smartgears_user }}'
unarchive: src={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}.war dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/gcube-app.xml remote_src=yes
when: data_transfer_service_install
tags: [ 'smartgears', 'smartgears_data_trasfer', 'tomcat' ]
- name: Force a smartgears restart
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted
when: smartgears_force_restart is defined and smartgears_force_restart

View File

@ -0,0 +1,17 @@
<application mode="{{ smartgears_application_mode }}">
<name>{{ data_trasfer_service_name }}</name>
<group>DataTransfer</group>
<version>{{ smartgears_distribution_version }}</version>
<description> "Data Transfer Service" </description>
{% if data_transfer_set_local_persistence %}
{% if smartgears_persistence_location is defined %}
<persistence location="{{ smartgears_persistence_location }}"/>
{% else %}
<local-persistence location='target' />
{% endif %}
{% else %}
<local-persistence location='target' />
{% endif %}
</application>