2016-06-13 16:24:30 +02:00
|
|
|
---
|
2017-09-14 13:41:55 +02:00
|
|
|
# This is only needed to force an upgrade
|
2017-09-13 16:33:16 +02:00
|
|
|
- block:
|
|
|
|
- name: Remove the old dataminer installation
|
|
|
|
file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=absent
|
|
|
|
|
|
|
|
become: True
|
|
|
|
become_user: '{{ smartgears_user }}'
|
|
|
|
when:
|
|
|
|
- dataminer_app_install
|
|
|
|
- dataminer_app_upgrade
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps' ]
|
|
|
|
|
2017-09-14 13:41:55 +02:00
|
|
|
# This is only needed to force an upgrade
|
2017-09-13 16:33:16 +02:00
|
|
|
- block:
|
|
|
|
- name: Remove the old dataminer algorithm installer
|
|
|
|
file: path={{ smartgears_user_home }}/algorithmInstaller state=absent
|
|
|
|
|
|
|
|
become: True
|
|
|
|
become_user: '{{ smartgears_user }}'
|
|
|
|
when:
|
|
|
|
- dataminer_app_install
|
|
|
|
- dataminer_algorithms_upgrade
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
|
|
|
|
|
2016-10-05 10:37:46 +02:00
|
|
|
- block:
|
|
|
|
- name: Get and unpack the dataminer application
|
2017-09-14 13:41:55 +02:00
|
|
|
maven_artifact: artifact_id={{ dataminer_wps_name }} version={{ dataminer_wps_version | default(omit) }} group_id={{ dataminer_wps_group_id }} extension={{ dataminer_wps_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ dataminer_wps_file }}
|
2017-09-13 16:35:12 +02:00
|
|
|
register: dataminer_app_downloaded
|
|
|
|
|
|
|
|
- name: Remove the old dataminer installation
|
|
|
|
file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=absent
|
|
|
|
when: (dataminer_app_downloaded | changed)
|
2017-05-08 18:20:57 +02:00
|
|
|
|
|
|
|
- name: Create the dataminer wps working directory
|
|
|
|
file: path={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
|
|
|
|
|
|
|
|
- name: Unarchive the dataminer_wps war
|
2017-09-14 13:41:55 +02:00
|
|
|
unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ dataminer_wps_file }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }} creates='{{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/WEB-INF/lib'
|
2017-05-08 18:20:57 +02:00
|
|
|
notify: Restart smartgears
|
|
|
|
|
2017-07-25 18:37:59 +02:00
|
|
|
- name: Install the dataminer web.xml
|
2017-10-13 15:15:30 +02:00
|
|
|
template: src=web.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/WEB-INF/web.xml
|
2017-07-25 18:37:59 +02:00
|
|
|
notify: Restart smartgears
|
|
|
|
|
2017-10-13 15:15:30 +02:00
|
|
|
- name: Verify if we have the old algorithms setup
|
|
|
|
stat: path={{ smartgears_user_home }}/wps_algorithms/algorithms/AAPS_NASO_PUBLISHER.jar
|
|
|
|
register: old_algo_setup
|
|
|
|
|
|
|
|
- name: Wipe away the algoriths directory if it comes from the old setup
|
|
|
|
file: dest={{ smartgears_user_home }}/wps_algorithms state=absent
|
|
|
|
when: old_algo_setup.stat.exists
|
|
|
|
|
2017-05-08 18:20:57 +02:00
|
|
|
- name: Create a directory where to install the algorithms directory
|
2017-10-06 16:04:00 +02:00
|
|
|
file: path={{ smartgears_user_home }}/wps_algorithms/algorithms state=directory
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_svn' ]
|
|
|
|
|
2017-10-11 09:24:21 +02:00
|
|
|
- name: Install the subversion packages
|
|
|
|
become_user: root
|
2017-10-13 15:15:30 +02:00
|
|
|
apt: pkg=subversion state=present update_cache=yes cache_valid_time=1800
|
2017-10-11 09:24:21 +02:00
|
|
|
|
2017-10-06 16:04:00 +02:00
|
|
|
- name: Download the WPS algorithms from subversion
|
|
|
|
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' ]
|
2017-05-08 18:20:57 +02:00
|
|
|
|
2017-09-12 17:18:00 +02:00
|
|
|
- name: Get and unpack the algorithms installer
|
2017-09-14 13:41:55 +02:00
|
|
|
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 }}
|
2017-09-13 16:33:16 +02:00
|
|
|
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)
|
2017-09-12 17:18:00 +02:00
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
|
|
|
|
|
|
|
|
- name: Unarchive the algorithms installer
|
2017-09-14 13:41:55 +02:00
|
|
|
unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ dataminer_algorithms_file }} dest={{ smartgears_user_home }} creates='{{ smartgears_user_home }}/algorithmInstaller/addAlgorithm.sh'
|
2017-09-12 17:18:00 +02:00
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_installer' ]
|
|
|
|
|
2017-09-04 19:37:03 +02:00
|
|
|
- name: Create a directory where to install the algorithms updater logs and data
|
|
|
|
file: path={{ smartgears_user_home }}/wps_algorithms_install_log state=directory
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ]
|
|
|
|
|
2017-06-22 14:39:07 +02:00
|
|
|
- name: Install a script that updates the algorithms repository and adds the missing algorithms configurations
|
|
|
|
become_user: "{{ d4science_ansible_become_user | default('root') }}"
|
|
|
|
template: src=algorithms-updater.j2 dest=/usr/local/bin/algorithms-updater mode=0755
|
2017-07-19 18:26:35 +02:00
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ]
|
2017-10-13 15:15:30 +02:00
|
|
|
|
|
|
|
- name: Remove the list of the installed algorithms if we are upgrading from the old algorithms setup
|
|
|
|
file: dest={{ smartgears_user_home }}/wps_algorithms_install_log/already_installed_algorithms.txt state=absent
|
|
|
|
when: old_algo_setup.stat.exists
|
2017-06-22 14:39:07 +02:00
|
|
|
|
|
|
|
- name: Cron job that updates the algorithms repository and adds the missing algorithms configurations
|
2017-09-19 14:17:37 +02:00
|
|
|
cron: name="SVN update the algorithms repository" minute="{{ dataminer_algorithms_updater_minute_frequency }}" hour="{{ dataminer_algorithms_updater_hour_frequency }}" job="/usr/local/bin/algorithms-updater > {{ smartgears_user_home }}/wps_algorithms_install_log/algorithms_updater_cron.log 2>&1" user='{{ smartgears_user }}' state={{ dataminer_algorithms_updater_cron }}
|
2017-07-25 17:51:26 +02:00
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_cron' ]
|
2017-05-15 13:02:13 +02:00
|
|
|
|
2016-10-05 13:31:10 +02:00
|
|
|
- name: Create a directory where to install the gebco_08.nc data file
|
|
|
|
file: path={{ smartgears_user_home }}/data state=directory
|
|
|
|
|
2016-10-05 10:37:46 +02:00
|
|
|
- name: Install the gebco_08.nc file from thredds. It is big, mostly 2GB
|
2016-10-11 17:42:01 +02:00
|
|
|
get_url: url={{ dataminer_data_file_from_thredds }} dest={{ smartgears_user_home }}/data/gebco_08.nc timeout=2400
|
2016-10-05 13:31:10 +02:00
|
|
|
|
|
|
|
- name: Create a symlink to the gebco_08.nc file
|
2017-05-08 18:20:57 +02:00
|
|
|
file: src={{ smartgears_user_home }}/data/gebco_08.nc dest={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/ecocfg/gebco_08.nc state=link
|
2016-10-05 10:37:46 +02:00
|
|
|
notify: Restart smartgears
|
2017-09-19 14:44:35 +02:00
|
|
|
|
|
|
|
- name: Install the old properties files
|
|
|
|
copy: src={{ item }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_wps_name }}/ecocfg/{{ item }} force=yes
|
|
|
|
with_items: '{{ dataminer_properties_files }}'
|
|
|
|
|
2016-10-05 10:37:46 +02:00
|
|
|
- name: Install the script that fixes the WPS configuration
|
2017-02-09 12:03:52 +01:00
|
|
|
become_user: "{{ d4science_ansible_become_user | default('root') }}"
|
2016-10-05 10:37:46 +02:00
|
|
|
template: src=wps-config-fixer.j2 dest=/usr/local/bin/wps-config-fixer owner=root group=root mode=0555
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
2016-09-08 14:47:44 +02:00
|
|
|
|
2017-09-26 16:28:40 +02:00
|
|
|
- name: Remove the catalina additional configuration
|
|
|
|
#template: src={{ dataminer_wps_name }}.xml.j2 dest={{ item.instance_path }}/conf/Catalina/localhost/{{ dataminer_wps_name }}.xml
|
|
|
|
file: dest={{ item.instance_path }}/conf/Catalina/localhost/{{ dataminer_wps_name }}.xml state=absent
|
2017-05-12 19:28:09 +02:00
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: Restart smartgears
|
|
|
|
|
2016-10-05 10:37:46 +02:00
|
|
|
- name: Fix the WPS config file
|
|
|
|
shell: /usr/local/bin/wps-config-fixer
|
|
|
|
# notify: Restart smartgears
|
2016-06-13 16:24:30 +02:00
|
|
|
|
2017-12-15 18:07:39 +01:00
|
|
|
- name: Install the nscd service to work around dns timeouts
|
|
|
|
become_user: root
|
|
|
|
apt: pkg=nscd state=present update_cache=yes cache_valid_time=1800
|
|
|
|
when: dataminer_install_nscd is defined and dataminer_install_nscd
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dm_nscd' ]
|
|
|
|
|
|
|
|
- name: Ensure thad the nscd service is enabled and running
|
|
|
|
become_user: root
|
|
|
|
service: name=nscd state=restarted enabled=yes
|
|
|
|
when: dataminer_install_nscd is defined and dataminer_install_nscd
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps', 'dm_nscd' ]
|
|
|
|
|
|
|
|
|
2016-06-23 12:15:37 +02:00
|
|
|
become: True
|
|
|
|
become_user: '{{ smartgears_user }}'
|
|
|
|
when: dataminer_app_install
|
|
|
|
tags: [ 'tomcat', 'dataminer', 'wps' ]
|
|
|
|
|