ansible-roles/smartgears/dataminer_app/tasks/dataminer-app.yml

150 lines
7.1 KiB
YAML

---
- name: Install some packages needed to download the dataminer environment
apt: pkg={{ item }} state=present
with_items: '{{ dataminer_additional_packages }}'
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer' ]
- name: Ensure that the maven configuration directory exists for the smartgears user
become: True
become_user: '{{ smartgears_user }}'
file: path={{ smartgears_user_home }}/.m2 state=directory mode=0755
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Create a directory where to install the pom file needed to download the dataminer jar
become: True
become_user: '{{ smartgears_user }}'
file: path={{ smartgears_user_home }}/.m2/dataminer state=directory mode=0755
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the maven configuration
become: True
become_user: '{{ smartgears_user }}'
template: src=maven-settings.xml.j2 dest={{ smartgears_user_home }}/.m2/settings.xml mode=0640
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install a fake maven POM file to download the dataminer app dependencies
become: True
become_user: '{{ smartgears_user }}'
template: src=pom.xml.j2 dest={{ smartgears_user_home }}/.m2/pom.xml mode=0640
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install a fake maven POM file to download the dataminer jar
become: True
become_user: '{{ smartgears_user }}'
template: src=dataminer-pom.xml.j2 dest={{ smartgears_user_home }}/.m2/dataminer/pom.xml mode=0640
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the rapidminer-custom jar
become: True
become_user: '{{ smartgears_user }}'
shell: mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -Dartifact=rapidminer-custom:52n-wps-server:3.3.2 -DoutputDirectory={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/52n-wps-server-3.3.2.jar'
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the org.gcube.dataanalysis dataminer jar
become: True
become_user: '{{ smartgears_user }}'
shell: cd {{ smartgears_user_home }}/.m2/dataminer ; mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -Dartifact=org.gcube.dataanalysis:dataminer:{{ dataminer_dataminer_jar_version }} -DoutputDirectory={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/dataminer-{{ dataminer_dataminer_jar_version }}.jar'
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the org.gcube.dataanalysis dataminer jar dependencies
become: True
become_user: '{{ smartgears_user }}'
shell: cd {{ smartgears_user_home }}/.m2 ; mvn -DexcludeScope=provided org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencies -Dartifact=org.gcube.dataanalysis:dataminer:{{ dataminer_dataminer_jar_version }} -DoutputDirectory={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/ecological-engine-1.8.6-3.9.0.jar'
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the 52n jars modified by D4Science
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ item }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/
with_items: '{{ dataminer_additional_jars_urls }}'
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_new_jars' ]
- name: Remove the unwanted jars from the 52 north webapp distribution and from the org.gcube.dataanalysis dataminer dependencies
become: True
become_user: '{{ smartgears_user }}'
file: dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/{{ item }} state=absent
with_items: '{{ dataminer_jars_to_remove }}'
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_deps_cleanup' ]
- name: Download the ecocfg config from subversion
become: True
become_user: '{{ smartgears_user }}'
subversion: repo={{ dataminer_ecocfg_svn_repo }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg force=yes
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Download the ecocfg parallel processing libraries from subversion
become: True
become_user: '{{ smartgears_user }}'
subversion: repo={{ dataminer_ecocfg_parallelproc_svn_repo }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING force=yes
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Install the gebco_08.nc file from thredds. It is big, mostly 2GB
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ dataminer_data_file_from_thredds }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/gebco_08.nc
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Download the dataminer algorithms jars from subversion
become: True
become_user: '{{ smartgears_user }}'
subversion: repo={{ dataminer_algorithms_repo }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/.algorithms
notify: Restart smartgears
register: dataminer_algorithms
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps', 'wps_algorithms' ]
- name: Move the dataminer algorithms jars to the right place
become: True
become_user: '{{ smartgears_user }}'
shell: cd {{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib ; mv {{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/.algorithms/*.jar .
notify: Restart smartgears
when:
- dataminer_app_install
- ( dataminer_algorithms | changed )
tags: [ 'tomcat', 'dataminer', 'wps', 'wps_algorithms' ]
- name: Install the wps config file
become: True
become_user: '{{ smartgears_user }}'
template: src=wps_config.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/config/wps_config.xml mode=0444
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Download the dataminer config jar
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ dataminer_configuration_jar_url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/lib/{{ dataminer_configuration_jar }} force=yes
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]