From 1e5f6b6e300e647717f8a4dd1e4a8f718bb1a130 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 19 Sep 2017 20:07:24 +0200 Subject: [PATCH] data-transfer-service: expand the war file after the installation and setup the gcube-app.xml file. --- smartgears/smartgears/defaults/main.yml | 5 +++- .../tasks/data-transfer-service.yml | 23 +++++++++++++++++++ smartgears/smartgears/tasks/main.yml | 2 ++ .../smartgears/tasks/smartgears-app.yml | 14 ----------- .../templates/data-transfer-gcube-app.xml.j2 | 17 ++++++++++++++ 5 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 smartgears/smartgears/tasks/data-transfer-service.yml create mode 100644 smartgears/smartgears/templates/data-transfer-gcube-app.xml.j2 diff --git a/smartgears/smartgears/defaults/main.yml b/smartgears/smartgears/defaults/main.yml index ecf68242..c114dd82 100644 --- a/smartgears/smartgears/defaults/main.yml +++ b/smartgears/smartgears/defaults/main.yml @@ -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 + diff --git a/smartgears/smartgears/tasks/data-transfer-service.yml b/smartgears/smartgears/tasks/data-transfer-service.yml new file mode 100644 index 00000000..7764fb05 --- /dev/null +++ b/smartgears/smartgears/tasks/data-transfer-service.yml @@ -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' ] + diff --git a/smartgears/smartgears/tasks/main.yml b/smartgears/smartgears/tasks/main.yml index 76ca3065..ffdaf9b5 100644 --- a/smartgears/smartgears/tasks/main.yml +++ b/smartgears/smartgears/tasks/main.yml @@ -1,4 +1,6 @@ --- - include: smartgears-app.yml +- include: data-transfer-service.yml + when: data_transfer_service_install - include: install-gcube-keys.yml diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml index 21bbd96b..6e3ab121 100644 --- a/smartgears/smartgears/tasks/smartgears-app.yml +++ b/smartgears/smartgears/tasks/smartgears-app.yml @@ -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 diff --git a/smartgears/smartgears/templates/data-transfer-gcube-app.xml.j2 b/smartgears/smartgears/templates/data-transfer-gcube-app.xml.j2 new file mode 100644 index 00000000..101711a9 --- /dev/null +++ b/smartgears/smartgears/templates/data-transfer-gcube-app.xml.j2 @@ -0,0 +1,17 @@ + + {{ data_trasfer_service_name }} + DataTransfer + {{ smartgears_distribution_version }} + "Data Transfer Service" +{% if data_transfer_set_local_persistence %} +{% if smartgears_persistence_location is defined %} + +{% else %} + +{% endif %} +{% else %} + +{% endif %} + + +