From 766a276cc2f903f2709fc0e2afc91e4d87d3d838 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 12 May 2017 13:24:01 +0200 Subject: [PATCH] library/roles/smartgears/dataminer_app: The war and zip versions of dataminer need to cohesist for the time being. --- smartgears/dataminer_app/defaults/main.yml | 7 +++++ .../dataminer_app/tasks/dataminer-app.yml | 4 --- .../dataminer_app/tasks/dataminer-zip.yml | 29 +++++++++++++++++++ smartgears/dataminer_app/tasks/main.yml | 3 ++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 smartgears/dataminer_app/tasks/dataminer-zip.yml diff --git a/smartgears/dataminer_app/defaults/main.yml b/smartgears/dataminer_app/defaults/main.yml index 5e5542c9..0e284b5c 100644 --- a/smartgears/dataminer_app/defaults/main.yml +++ b/smartgears/dataminer_app/defaults/main.yml @@ -2,6 +2,12 @@ dataminer_app_install: False dataminer_app_upgrade: False +# ZIP file +dataminer_product: prod +-dataminer_zip_url: 'http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/DataMinerConfiguration/webapp/{{ dataminer_product }}/wps.zip' + +# Install from WAR +dataminer_war_install: False dataminer_wps_version: latest dataminer_wps_name: wps dataminer_wps_group_id: org.gcube.data-analysis @@ -9,4 +15,5 @@ dataminer_wps_extension: war dataminer_wps_file: '{{ dataminer_wps_name }}-{{ dataminer_wps_version }}.{{ dataminer_wps_extension }}' dataminer_wps_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}' dataminer_wps_algorithms_svn: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/DataMinerConfiguration/algorithms/ + dataminer_data_file_from_thredds: 'http://thredds.d4science.org/thredds/fileServer/public/netcdf/gebco_08_OCEANS_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_.nc' diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index 29589411..c65529b5 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -16,10 +16,6 @@ - name: Download the WPS algorithms from subversion subversion: repo={{ dataminer_wps_algorithms_svn }} dest={{ smartgears_user_home }}/wps_algorithms/algorithms checkout=yes force=yes update=yes - - name: TEMPORARY copy the dataminer algorithms into the WPS WEB-INF/lib - shell: cp -a {{ smartgears_user_home }}/wps_algorithms/algorithms/*.jar {{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/WEB-INF/lib/ - when: dataminer_wps_copy_algorithms is defined and dataminer_wps_copy_algorithms - - name: Create a directory where to install the gebco_08.nc data file file: path={{ smartgears_user_home }}/data state=directory diff --git a/smartgears/dataminer_app/tasks/dataminer-zip.yml b/smartgears/dataminer_app/tasks/dataminer-zip.yml new file mode 100644 index 00000000..56e0d40d --- /dev/null +++ b/smartgears/dataminer_app/tasks/dataminer-zip.yml @@ -0,0 +1,29 @@ +--- +- block: + - name: Get and unpack the dataminer application + unarchive: src={{ dataminer_zip_url }} dest={{ smartgears_instance_path }}/webapps copy=no creates={{ smartgears_instance_path }}/webapps/wps/config/wps_config.xml + + - name: Create a directory where to install the gebco_08.nc data file + file: path={{ smartgears_user_home }}/data state=directory + + - name: Install the gebco_08.nc file from thredds. It is big, mostly 2GB + get_url: url={{ dataminer_data_file_from_thredds }} dest={{ smartgears_user_home }}/data/gebco_08.nc timeout=2400 + + - name: Create a symlink to the gebco_08.nc file + file: src={{ smartgears_user_home }}/data/gebco_08.nc dest={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/ecocfg/gebco_08.nc state=link + notify: Restart smartgears + + - name: Install the script that fixes the WPS configuration + become_user: "{{ d4science_ansible_become_user | default('root') }}" + template: src=wps-config-fixer.j2 dest=/usr/local/bin/wps-config-fixer owner=root group=root mode=0555 + with_items: '{{ tomcat_m_instances }}' + + - name: Fix the WPS config file + shell: /usr/local/bin/wps-config-fixer +# notify: Restart smartgears + + become: True + become_user: '{{ smartgears_user }}' + when: dataminer_app_install + tags: [ 'tomcat', 'dataminer', 'wps' ] + diff --git a/smartgears/dataminer_app/tasks/main.yml b/smartgears/dataminer_app/tasks/main.yml index 7241d0bc..fcb18262 100644 --- a/smartgears/dataminer_app/tasks/main.yml +++ b/smartgears/dataminer_app/tasks/main.yml @@ -2,4 +2,7 @@ - include: dataminer-upgrade.yml when: dataminer_app_upgrade - include: dataminer-app.yml + when: dataminer_war_install +- include: dataminer-zip.yml + when: not dataminer_war_install - include: install-gcube-key.yml