From 9ef7736f10cf02bbb377a3b93a6523a1634d0356 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 23 Mar 2018 13:40:09 +0100 Subject: [PATCH] Cleanup some dataminer tasks. Remove the old zip installation tasks. --- .../dataminer_app/tasks/dataminer-app.yml | 11 ++++--- .../dataminer_app/tasks/dataminer-zip.yml | 29 ------------------- smartgears/dataminer_app/tasks/main.yml | 8 ++--- 3 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 smartgears/dataminer_app/tasks/dataminer-zip.yml diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index 94027493..5da36409 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -13,9 +13,12 @@ # This is only needed to force an upgrade - block: - - name: Remove the old dataminer algorithm installer + - name: Remove the old dataminer algorithm installer to force an upgrade file: path={{ smartgears_user_home }}/algorithmInstaller state=absent + - name: Remove the old dataminer algorithm installer distributions from the downloads directory + shell: rm -fr {{ smartgears_user_home }}/downloads/dataminer-algorithms-importer*.tar.gz + become: True become_user: '{{ smartgears_user }}' when: @@ -30,7 +33,7 @@ - name: Remove the old dataminer installation file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=absent - when: (dataminer_app_downloaded | changed) + when: dataminer_app_downloaded is changed - name: Create the dataminer wps working directory file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} @@ -63,14 +66,14 @@ subversion: repo={{ dataminer_wps_algorithms_svn }} dest={{ smartgears_user_home }}/wps_algorithms/algorithms/{{ dataminer_infra_reference }} checkout=yes force=yes update=yes tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_svn' ] - - name: Get and unpack the algorithms installer + - name: Get the algorithms installer via maven_artifact maven_artifact: artifact_id={{ dataminer_algorithms_name }} version={{ dataminer_algorithms_version | default(omit) }} group_id={{ dataminer_algorithms_group_id }} extension={{ dataminer_algorithms_extension | default('war') }} repository_url={{ dataminer_algorithms_base_url }} dest={{ smartgears_downloads_dir }}/{{ dataminer_algorithms_file }} register: algorithms_installer_downloaded tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ] - name: Remove the old dataminer algorithm installer file: path={{ smartgears_user_home }}/algorithmInstaller state=absent - when: (algorithms_installer_downloaded | changed) + when: algorithms_installer_downloaded is changed tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ] - name: Unarchive the algorithms installer diff --git a/smartgears/dataminer_app/tasks/dataminer-zip.yml b/smartgears/dataminer_app/tasks/dataminer-zip.yml deleted file mode 100644 index 56e0d40d..00000000 --- a/smartgears/dataminer_app/tasks/dataminer-zip.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- 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 fcb18262..d044658b 100644 --- a/smartgears/dataminer_app/tasks/main.yml +++ b/smartgears/dataminer_app/tasks/main.yml @@ -1,8 +1,6 @@ --- -- include: dataminer-upgrade.yml +- import_tasks: dataminer-upgrade.yml when: dataminer_app_upgrade -- include: dataminer-app.yml +- import_tasks: dataminer-app.yml when: dataminer_war_install -- include: dataminer-zip.yml - when: not dataminer_war_install -- include: install-gcube-key.yml +- import_tasks: install-gcube-key.yml