library/roles/ghn-gcore, library/roles/smartgears: Move the ghn and smartgears roles from d4science-ghn-cluster to the shared library

This commit is contained in:
Andrea Dell'Amico 2016-06-13 16:24:30 +02:00
parent 52fc34bd95
commit 24e5f76098
53 changed files with 1661 additions and 0 deletions

View File

@ -0,0 +1,15 @@
---
- name: Download the Gcore upgrade script
become: True
become_user: '{{ item }}'
get_url: url={{ gcore_upgrade_script_url }} dest=/home/{{ item }} validate_certs=no
with_items: '{{ gcube_users }}'
tags: gcore_upgrade
- name: Run the Gcore upgrade script
become: True
become_user: '{{ item }}'
shell: . /home/{{ item }}/.bashrc ; cd /home/{{ item }} ; chmod 555 ./{{ gcore_upgrade_script }} ; ./{{ gcore_upgrade_script }} {{ http_port }} {{ restart_on_upgrade }} force
with_items: '{{ gcube_users }}'
tags: gcore_upgrade

View File

@ -0,0 +1,19 @@
---
# Install the gcore boot script
- name: Install the gcore boot script
template: src=gcore.j2 dest=/etc/init.d/{{ item }} owner=root group=root mode=0755
with_items: 'gcore'
when:
- gcoreboot_install
tags: [ 'gcoreboot' ]
- name: Enable the gcore boot script
file: src=/etc/init.d/{{ item }} dest=/etc/rc2.d/S95gcore state=link
file: src=/etc/init.d/{{ item }} dest=/etc/rc3.d/S95gcore state=link
file: src=/etc/init.d/{{ item }} dest=/etc/rc0.d/K25gcore state=link
file: src=/etc/init.d/{{ item }} dest=/etc/rc1.d/K25gcore state=link
with_items: 'gcore'
when:
- gcoreboot_install
tags: [ 'gcoreboot' ]

View File

@ -0,0 +1,33 @@
#!/bin/bash
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
case "${1:-''}" in
'start')
test=$(cat /etc/passwd | cut -d":" -f1 | grep gcube)
for elemento in $test; do
echo "entering on $elemento"
path="/home/$elemento/startContainer.sh"
if [ -e "$path" ]
then
su $elemento -c "source $path"
fi
echo "exiting from $elemento"
done
;;
'stop')
test=$(cat /etc/passwd | cut -d":" -f1 | grep gcube)
for elemento in $test; do
echo "entering on $elemento"
path="/home/$elemento/stopContainer.sh"
if [ -e "$path" ]
then
su $elemento -c "source $path"
fi
echo "exiting from $elemento"
done
;;
*)
echo "Usage: $SELF {start|stop}"
exit 1
;;
esac

View File

@ -0,0 +1,27 @@
---
# Old stuff, do not use
#
- name: Stop the gcube service
shell: /home/{{ gcube_user }}/stopContainer.sh >/dev/null 2>&1
#shell: su - {{ gcube_user }} /home/{{ gcube_user }}/gCore/bin/gcore-stop-container
ignore_errors: True
tags:
- ghn
- name: Install the new ghn release
action: ghn_r_cluster user={{ gcube_user }}
tags:
- ghn
- name: Replace the hostname in the gCore/etc/globus_wsrf_core/server-config.wsdd configuration file
lineinfile: dest=/home/{{ gcube_user }}/gCore/etc/globus_wsrf_core/server-config.wsdd regexp="<parameter name=\"logicalHost\" value=\".*/>" line="<parameter name=\"logicalHost\" value=\"{{ ansible_fqdn }}\"/>"
tags:
- ghn
- ghnconfig
- name: Replace JAVA_HOME in /home/{{ gcube_user }}/.gcorerc
lineinfile: dest=/home/{{ gcube_user }}/.gcorerc regexp="^export JAVA_HOME=.*" line="export JAVA_HOME={{ jdk_java_home }}"
tags:
- ghn
- ghnconfig
- jdk

View File

@ -0,0 +1,8 @@
---
- name: Restart ghn webservice
shell: /etc/init.d/gcore stop ; /etc/init.d/gcore start
when:
- restart_gcore_service
- ( has_tomcat is defined ) and ( not has_tomcat )
ignore_errors: True

View File

@ -0,0 +1,10 @@
---
- name: Install the gcube keys
copy: src=/tmp/symm.key dest=/home/{{ item.0 }}/{{ gcube_conf_path }}/{{ item.1 }} owner={{ item.0 }} group={{ item.0 }} mode=0400
with_nested:
- '{{ gcube_users }}'
- '{{ gcube_symm_key_file }}'
notify: Restart ghn webservice
tags:
- gcube_key

View File

@ -0,0 +1,6 @@
---
couchdb_cache_se_plugin_install: False
#couchdb_cache_se_plugin_ver: 1.0.0-3.10.1
couchdb_cache_se_plugin_ver: 1.1.0-3.11.0-128111
couchdb_cache_se_plugin_name: 'couchdb-cache-se-plugin-{{ couchdb_cache_se_plugin_ver }}-jar-with-dependencies.jar'
couchdb_cache_se_plugin_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/accounting/couchdb-cache-se-plugin/{{ couchdb_cache_se_plugin_ver }}/{{ couchdb_cache_se_plugin_name }}'

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,9 @@
---
- name: Get the couchdb cache se plugin and install it inside the smart executor
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ couchdb_cache_se_plugin_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: couchdb_cache_se_plugin_install
notify: Restart smartgears
tags: [ 'smartgears', 'couchdb_cache_se', 'tomcat' ]

View File

@ -0,0 +1,50 @@
---
dataminer_app_install: False
dataminer_app_upgrade: False
dataminer_52north_webapp_name: wps
dataminer_52north_webapp_context: '/{{ dataminer_52north_webapp_name }}'
dataminer_52north_webapp_file: 52n-wps-webapp-3.3.2-20150523.010021-9.war
#dataminer_52north_webapp_url: 'http://build.dev.52north.org/jenkins/view/Processing/job/52n-wps_GIT-DEV_nightly_builds/lastSuccessfulBuild/org.n52.wps$52n-wps-webapp/artifact/org.n52.wps/52n-wps-webapp/3.3.2-20150523.010021-9/{{ dataminer_52north_webapp_file }}'
dataminer_52north_webapp_url: 'http://data.d4science.org/uri-resolver/id?fileName=wps-3.3.2.war&smp-id=565d67b7e4b0eacf4a0fc5ad&contentType=application%2Fx-tika-java-web-archive'
dataminer_maven_enable_gcube_snapshots: False
#dataminer_dataminer_jar_version: 1.0.1-3.10.0
dataminer_dataminer_jar_version: 1.0.2-3.10.1
dataminer_dataminer_jar_version_range: "[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)"
dataminer_gcube_web_xml: "http://data.d4science.org/id?fileName=web.xml&smp-id=56615ae0e4b0158fcb561817&contentType=application%2Fxml"
dataminer_gcube_app_xml: "http://data.d4science.org/id?fileName=gcube-app.xml&smp-id=56615ae0e4b0158fcb561815&contentType=application%2Fxml"
dataminer_jars_to_remove:
- 52n-wps-server-3.3.2-SNAPSHOT.jar
- 52n-wps-io-impl-3.3.1.jar
- 52n-wps-database-3.3.1.jar
- 52n-wps-server-3.3.1.jar
- 52n-wps-algorithm-3.3.1.jar
- 52n-wps-commons-3.3.1.jar
- 52n-wps-io-3.3.1.jar
- commons-beanutils-1.7.0.jar
- dom4j-1.6.jar
- jaxen-1.1.1.jar
- jcl-over-slf4j-1.6.4.jar
- jdom-1.0.jar
- logback-core-1.0.13.jar
- slf4j-api-1.7.5.jar
- spring-beans-2.0.6.jar
- spring-context-2.0.6.jar
- spring-core-2.0.6.jar
- registry-publisher-1.2.5-3.10.0.jar
dataminer_ecocfg_svn_repo: 'http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/DataMinerConfiguration/cfg'
dataminer_ecocfg_parallelproc_svn_repo: 'http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/DataMinerConfiguration/PARALLEL_PROCESSING'
# Retrieve and modify in a template before each installation.
dataminer_wps_config: 'http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/DataMinerConfiguration/wpscfg/wps_config.xml'
# Those packages are needed to download and configure the dataminer application
dataminer_additional_packages:
- subversion
- maven

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name=tomcat-instance-{{ smartgears_http_port }} state=restarted

View File

@ -0,0 +1,105 @@
---
- 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: 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 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' ]

View File

@ -0,0 +1,11 @@
---
- name: If it is an upgrade, shut down the server
service: name=tomcat-instance-{{ smartgears_http_port }} state=stopped
when: dataminer_app_upgrade
tags: [ 'tomcat', 'dataminer', 'dataminer_upgrade' ]
- name: If it is an upgrade, brutally remove the wps installation
file: dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }} state=absent
when: dataminer_app_upgrade
tags: [ 'tomcat', 'dataminer', 'dataminer_upgrade' ]

View File

@ -0,0 +1,20 @@
---
- name: Install the production gcube keys
get_url: url={{ item.url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING owner={{ smartgears_user }} group={{ smartgears_user }} mode=0400
with_items:
- '{{ gcube_prod_key_1 }}'
- '{{ gcube_prod_key_2 }}'
- '{{ gcube_prod_key_3 }}'
notify: Restart smartgears
when: install_gcube_prod_key
tags: [ 'dataminer', 'gcube_key' ]
- name: Install the devel gcube keys
get_url: url={{ item.url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING owner={{ smartgears_user }} group={{ smartgears_user }} mode=0400
with_items:
- '{{ gcube_dev_key_1 }}'
- '{{ gcube_dev_key_2 }}'
- '{{ gcube_dev_key_3 }}'
notify: Restart smartgears
when: install_gcube_dev_key
tags: [ 'dataminer', 'gcube_key' ]

View File

@ -0,0 +1,6 @@
---
- include: dataminer-upgrade.yml
when: dataminer_app_upgrade
- include: w52n-app.yml
- include: dataminer-app.yml
- include: install-gcube-key.yml

View File

@ -0,0 +1,61 @@
---
# NOTE: Install as the smartgears user so we do not mess with the permissions
- name: Get the 52 north application war file
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ dataminer_52north_webapp_url }} dest={{ smartgears_user_home }}/{{ dataminer_52north_webapp_file }}
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Create the 52 north webapp directory and subdirectories
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
file: dest={{ smartgears_instance_path }}/webapps/{{ item }} state=directory mode=0755
with_items:
- '{{ dataminer_52north_webapp_name }}'
- '{{ dataminer_52north_webapp_name }}/persistence'
# - '{{ dataminer_52north_webapp_name }}/ecocfg'
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Unarchive the 52 north webapp distribution
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
unarchive: copy=no src={{ smartgears_user_home }}/{{ dataminer_52north_webapp_file }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/classes/52N_license.txt'
register: install_52_north
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Remove the original web.xml file
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
file: dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/web.xml state=absent
notify: Restart smartgears
when: ( install_52_north | changed )
tags: [ 'tomcat', 'dataminer', 'wps' ]
# Transform the 52n-wps app in a gcube enabled app
- name: Download the gcube web.xml config file
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ dataminer_gcube_web_xml }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/web.xml
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]
- name: Download the gcube gcube-app.xml config file
remote_user: root
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ dataminer_gcube_app_xml }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/WEB-INF/gcube-app.xml
notify: Restart smartgears
when: dataminer_app_install
tags: [ 'tomcat', 'dataminer', 'wps' ]

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube</groupId>
<artifactId>dataminer</artifactId>
<packaging>jar</packaging>
<version>{{ dataminer_dataminer_jar_version }}</version>
<dependencies>
<dependency>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>dataminer</artifactId>
<version>{{ dataminer_dataminer_jar_version }}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,93 @@
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>gcube-snapshots</id>
</server>
</servers>
<profiles>
<profile>
<id>gcube</id>
<repositories>
<repository>
<id>gcube-snapshots</id>
<name>gCube Snapshots</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>{{ dataminer_maven_enable_gcube_snapshots }}</enabled>
</snapshots>
</repository>
<repository>
<id>gcube-releases</id>
<name>gCube Releases</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>gcube-externals</id>
<name>gCube Externals</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-externals</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>gcube-snapshots</id>
<name>gCube Snapshots</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>{{ dataminer_maven_enable_gcube_snapshots }}</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>gcube-releases</id>
<name>gCube Releases</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>gcube-externals</id>
<name>gCube Externals</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-externals</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>gcube</activeProfile>
</activeProfiles>
</settings>

View File

@ -0,0 +1,267 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
<relativePath />
</parent>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>dataminer</artifactId>
<version>{{ dataminer_dataminer_jar_version }}</version>
<name>dataminer</name>
<description>dataminer</description>
<properties>
<distroDirectory>${project.basedir}/distro</distroDirectory>
</properties>
<dependencies>
<dependency>
<groupId>org.gcube.dataaccess.algorithms</groupId>
<artifactId>database-rm-algorithms</artifactId>
<version>[1.0.0-SNAPSHOT,1.4.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>common-encryption</artifactId>
<groupId>org.gcube.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-io</artifactId>
<version>[3.3.1,4.0.0)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-io-impl</artifactId>
<version>[3.3.1,4.0.0)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-algorithm</artifactId>
<version>[3.3.1,4.0.0)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-server</artifactId>
<version>[3.3.1,4.0.0)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency> <groupId>org.gcube.dataanalysis</groupId> <artifactId>ecological-engine</artifactId>
<version>[1.8.5-SNAPSHOT,2.0.0-SNAPSHOT)</version> <exclusions> <exclusion>
<artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion>
</exclusions> </dependency> -->
<dependency>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine-wps-extension</artifactId>
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine-geospatial-extensions</artifactId>
<version>[1.3.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine-external-algorithms</artifactId>
<version>[1.1.5-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>common-utils-encryption</artifactId>
<groupId>org.gcube.core</groupId>
</exclusion>
<exclusion>
<artifactId>common-encryption</artifactId>
<groupId>org.gcube.core</groupId>
</exclusion>
<!-- <exclusion> <artifactId>accounting-lib</artifactId> <groupId>org.gcube.accounting</groupId>
</exclusion> -->
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine-smart-executor</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<!-- ><exclusion> <artifactId>common-encryption</artifactId> <groupId>org.gcube.core</groupId>
</exclusion> -->
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.10</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<!-- <scope>test</scope> -->
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>common-utils-encryption</artifactId>
<groupId>org.gcube.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope</artifactId>
<version>[1.2.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-profile</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<directory>${distroDirectory}</directory>
<filtering>true</filtering>
<includes>
<include>profile.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>n52-releases</id>
<name>52n Releases</name>
<url>http://52north.org/maven/repo/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<WPSConfiguration xmlns="http://n52.org/wps">
<Datahandlers>
<ParserList>
<Parser name="WCPSQueryParser" className="org.n52.wps.io.datahandler.parser.WCPSQueryParser" active="true">
<Format mimetype="text/plain" schema="http://schemas.opengis.net/wcps/1.0/wcpsAll.xsd"/>
</Parser>
<Parser name="WKTParser" className="org.n52.wps.io.datahandler.parser.WKTParser" active="true">
<Format mimetype="application/wkt"/>
</Parser>
<Parser name="GenericXMLDataParser" className="org.n52.wps.io.datahandler.parser.GenericXMLDataParser" active="true">
<Format mimetype="text/xml; subtype=gml/2.1.2" schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<Format mimetype="text/xml"/>
</Parser>
<Parser name="GenericFileParser" className="org.n52.wps.io.datahandler.parser.GenericFileParser" active="true">
<Format mimetype="text/xml"/>
<Format mimetype="text/csv"/>
<Format mimetype="text/plain"/>
</Parser>
<Parser name="D4ScienceFileParser" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.D4ScienceFileParser" active="true">
<Format mimetype="text/xml"/>
<Format mimetype="application/d4science"/>
</Parser>
<Parser name="GisLinkParser" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.GisLinkParser" active="true">
<Format mimetype="application/geotiff"/>
<Format mimetype="application/wcs"/>
<Format mimetype="application/asc"/>
<Format mimetype="text/plain"/>
<Format mimetype="application/wfs"/>
<Format mimetype="application/opendap"/>
</Parser>
</ParserList>
<GeneratorList>
<Generator name="WKTGenerator" className="org.n52.wps.io.datahandler.generator.WKTGenerator" active="true">
<Format mimetype="application/wkt"/>
</Generator>
<Generator name="GenericXMLDataGenerator" className="org.n52.wps.io.datahandler.generator.GenericXMLDataGenerator" active="true">
<Format mimetype="text/xml; subtype=gml/2.1.2" schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
</Generator>
<Generator name="GenericFileGenerator" className="org.n52.wps.io.datahandler.generator.GenericFileGenerator" active="true">
<Format mimetype="text/plain"/>
</Generator>
<Generator name="PngFileGenerator" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.PngFileGenerator" active="true">
<Format mimetype="image/png"/>
</Generator>
<Generator name="GifFileGenerator" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.GifFileGenerator" active="true">
<Format mimetype="image/gif"/>
</Generator>
<Generator name="D4ScienceFileGenerator" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.D4ScienceFileGenerator" active="true">
<Format mimetype="application/d4science"/>
</Generator>
<Generator name="CsvFileGenerator" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.CsvFileGenerator" active="true">
<Format mimetype="text/csv"/>
</Generator>
<Generator name="GisLinkGenerator" className="org.gcube.dataanalysis.wps.statisticalmanager.synchserver.bindings.GisLinkGenerator" active="true">
<Format mimetype="application/wms"/>
</Generator>
</GeneratorList>
</Datahandlers>
<AlgorithmRepositoryList>
<Repository name="LocalAlgorithmRepository" className="org.n52.wps.server.LocalAlgorithmRepository" active="true">
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.DBSCAN</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.KMEANS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.LOF</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.XMEANS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.DISCREPANCY_ANALYSIS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.HRS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.MAPS_COMPARISON</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.QUALITY_ANALYSIS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.BIONYM</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.CMSY</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.ICCAT_VPA</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ABSENCE_CELLS_FROM_AQUAMAPS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.BIONYM_LOCAL</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CSQUARE_COLUMN_CREATOR</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ESRI_GRID_EXTRACTION</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.FAO_OCEAN_AREA_COLUMN_CREATOR</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.FAO_OCEAN_AREA_COLUMN_CREATOR_FROM_QUADRANT</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GENERIC_CHARTS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GEO_CHART</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.HCAF_FILTER</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MAX_ENT_NICHE_MODELLING</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_MOST_OBSERVED_SPECIES</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_MOST_OBSERVED_TAXA</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_SINGLE_SPECIES_DISTRIBUTION_PER_AREA</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_SPECIES_OBSERVATIONS_PER_LME_AREA</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_SPECIES_OBSERVATIONS_PER_MEOW_AREA</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_SPECIES_OBSERVATIONS_PER_YEAR</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OBIS_TAXA_OBSERVATIONS_PER_YEAR</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OCCURRENCE_ENRICHMENT</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.PRESENCE_CELLS_GENERATION</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.RASTER_DATA_PUBLISHER</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SGVM_INTERPOLATION</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SUBMITQUERY</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIMEEXTRACTION</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIMEEXTRACTION_TABLE</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_GEO_CHART</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_SERIES_ANALYSIS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_SERIES_CHARTS</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.XYEXTRACTOR</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.XYEXTRACTOR_TABLE</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ZEXTRACTION</Property>
<Property name="Algorithm" active="true">org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ZEXTRACTION_TABLE</Property>
<Property name="Algorithm" active="true">org.n52.wps.demo.TestIO</Property>
</Repository>
<Repository name="UploadedAlgorithmRepository" className="org.n52.wps.server.UploadedAlgorithmRepository" active="false"/>
<Repository name="ServiceLoaderAlgorithmRepository" className="org.n52.wps.server.ServiceLoaderAlgorithmRepository" active="true"/>
</AlgorithmRepositoryList>
<RemoteRepositoryList/>
<Server protocol="http" hostname="{{ ansible_fqdn }}" hostport="{{ http_port }}" includeDataInputsInResponse="false" computationTimeoutMilliSeconds="3600000" cacheCapabilites="false" webappPath="{{ dataminer_52north_webapp_name }}" repoReloadInterval="0.0" minPoolSize="10" maxPoolSize="20" keepAliveSeconds="1000" maxQueuedTasks="100">
<Database/>
</Server>
</WPSConfiguration>

View File

@ -0,0 +1,9 @@
---
generic_worker_install: False
#smart_generic_worker_plugin_ver: 1.0.1-3.9.0
#smart_generic_worker_plugin_ver: 1.0.2-3.10.1
smart_generic_worker_plugin_ver: 1.0.3-3.11.0-128830
smart_generic_worker_plugin_name: 'smart-generic-worker-{{ smart_generic_worker_plugin_ver }}-jar-with-dependencies.jar'
smart_generic_worker_plugin_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/dataanalysis/smart-generic-worker/{{ smart_generic_worker_plugin_ver }}/{{ smart_generic_worker_plugin_name }}'

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,9 @@
---
- name: Get the smart generic worker plugin and install it inside the smart executor
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ smart_generic_worker_plugin_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: generic_worker_install
notify: Restart smartgears
tags: [ 'smartgears', 'generic_worker', 'tomcat' ]

View File

@ -0,0 +1,19 @@
---
- name: Install the production gcube keys
get_url: url={{ item.url }} dest=/{{ gcube_tomcat_lib_dir }}/{{ item.name }} owner={{ d4science_user }} group={{ d4science_user }} mode=0400
with_items:
- '{{ gcube_prod_key_1 }}'
- '{{ gcube_prod_key_2 }}'
- '{{ gcube_prod_key_3 }}'
when: install_gcube_prod_key
tags: gcube_key
- name: Install the devel gcube keys
get_url: url={{ item.url }} dest=/{{ gcube_tomcat_lib_dir }}/{{ item.name }} owner={{ d4science_user }} group={{ d4science_user }} mode=0400
with_items:
- '{{ gcube_dev_key_1 }}'
- '{{ gcube_dev_key_2 }}'
- '{{ gcube_dev_key_3 }}'
when: install_gcube_dev_key
tags: gcube_key

View File

@ -0,0 +1,5 @@
---
is_sweeper_se_plugin_install: False
is_sweeper_se_plugin_ver: 1.0.0-3.11.0-128833
is_sweeper_se_plugin_name: 'is-sweeper-se-plugin-{{ is_sweeper_se_plugin_ver }}-jar-with-dependencies.jar'
is_sweeper_se_plugin_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/information-system/is-sweeper-se-plugin/{{ is_sweeper_se_plugin_ver }}/{{ is_sweeper_se_plugin_name }}'

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,9 @@
---
- name: Get the is-sweeper se plugin and install it inside the smart executor
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ is_sweeper_se_plugin_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: is_sweeper_se_plugin_install
notify: Restart smartgears
tags: [ 'smartgears', 'is_sweeper_se', 'tomcat' ]

View File

@ -0,0 +1,24 @@
---
smart_executor_install: False
#smart_executor_version: 1.2.0-3.9.0
#smart_executor_version: 1.3.0-3.10.1
smart_executor_version: 1.3.0-3.11.0-128844
smart_executor_name: smart-executor
smart_executor_file: '{{ smart_executor_name }}-{{ smart_executor_version }}.war'
smart_executor_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/vremanagement/smart-executor/{{ smart_executor_version }}/{{ smart_executor_file }}'
smart_executor_context: '/{{ smart_executor_name }}'
smart_executor_contexts_list:
- ''
- '/BiodiversityLab'
- '/BiOnym'
- '/ScalableDataMining'
# dev has two different contexts
#smart_executor_contexts_list:
# - ''
# - '/devVRE'
# - ''
# - '/NextNext'

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,41 @@
---
- name: Remove the old smart executor files
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=absent
when:
- smart_executor_install
- smartgears_upgrade
tags: [ 'smartgears', 'tomcat' ]
# NOTE: Install as the smartgears user so we do not mess with the permissions
- name: Get the smart executor plugin
get_url: url={{ smart_executor_url }} dest={{ smartgears_user_home }}/{{ smart_executor_file }}
when: smart_executor_install
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
- name: Create the smart executor working directory
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
when: smart_executor_install
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
- name: Unarchive the smartexecutor distribution
become: True
become_user: '{{ smartgears_user }}'
unarchive: copy=no src={{ smartgears_user_home }}/{{ smart_executor_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} creates={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: smart_executor_install
notify: Restart smartgears
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
- name: Install the smartgears configuration file
template: src=smart_executor-container.xml.j2 dest={{ smartgears_install_path }}/container.xml owner={{ item.user }} group={{ item.user }}
with_items: '{{ tomcat_m_instances }}'
notify: Restart smartgears
when: smart_executor_install
register: smartexec_containerxml_state
tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ]
- name: Remove the smartgears application state if the configuration changed
file: dest={{ smartgears_install_path }}/state state=absent
notify: Restart smartgears
when: ( smartexec_containerxml_state | changed )
tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ]

View File

@ -0,0 +1,34 @@
<container mode='{{ smartgears_mode }}'>
<hostname>{{ smartgears_hostname }}</hostname>
{%if setup_nginx %}
{%if https_port is defined %}
<port>{{ https_port }}</port>
{% else %}
<port>{{ http_port }}</port>
{% endif %}
{% else %}
<port>{{ item.http_port }}</port>
{% endif %}
<infrastructure>{{ smartgears_infrastructure_name }}</infrastructure>
<vo>{{ smartgears_vo_name }}</vo>
<site>
<country>{{ smartgears_country }}</country>
<location>{{ smartgears_location }}</location>
<latitude>41.9000</latitude>
<longitude>12.5000</longitude>
</site>
<property name='SmartGearsDistribution' value='{{ smartgears_distribution_version }}' />
<property name='SmartGearsDistributionBundle' value='UnBundled' />
<publication-frequency>60</publication-frequency>
{% if smart_executor_install %}
<application mode="{{ smartgears_mode }}" context="{{ smart_executor_context }}">
{% for context in smart_executor_contexts_list %}
<scope>/{{ smartgears_infrastructure_name }}/{{ smartgears_vo_name }}{{ context }}</scope>
{% endfor %}
</application>
{% endif %}
</container>

View File

@ -0,0 +1,3 @@
---
dependencies:
- role: '../../library/roles/nginx'

View File

@ -0,0 +1,22 @@
---
# Install the nginx virtualhosts
- name: Install the nginx virtualhosts
template: src={{ item.servername }}-virtualhost.j2 dest=/etc/nginx/sites-available/{{ item.servername }} owner=root group=root mode=0444
with_items: '{{ tomcat_m_instances }}'
when: not smartgears_install_generic_virthost
notify: Reload nginx
tags: [ 'nginx', 'virtualhost' ]
- name: Install the nginx smartexecutor virtualhost
template: src=generic-smartgears-virtualhost.j2 dest=/etc/nginx/sites-available/{{ item.servername }} owner=root group=root mode=0444
with_items: '{{ tomcat_m_instances }}'
when: smartgears_install_generic_virthost
notify: Reload nginx
tags: [ 'nginx', 'virtualhost' ]
- name: Enable the nginx virtualhosts
file: src=/etc/nginx/sites-available/{{ item.servername }} dest=/etc/nginx/sites-enabled/{{ item.servername }}.conf state=link
with_items: '{{ tomcat_m_instances }}'
notify: Reload nginx
tags: [ 'nginx', 'virtualhost' ]

View File

@ -0,0 +1,65 @@
server {
listen {{ http_port }};
server_name {{ item.servername }};
log_format forwarderLog '$remote_addr forwarded for $http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';
log_format shortForwarderLog '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
access_log /var/log/nginx/{{ item.servername }}_access.log shortForwarderLog;
# This is the default for nginx on Ubuntu 12.04
root /usr/share/nginx/www/;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location /logs {
alias /var/log/nginx;
allow {{ analytics_ip }}; # analytics.d4science.org
deny all;
}
# don't send the nginx version number in error pages and Server header
server_tokens off;
# Proxy stuff
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffer_size {{ nginx_proxy_buffer_size }};
proxy_buffers {{ nginx_proxy_buffers }};
proxy_busy_buffers_size {{ nginx_proxy_busy_buffers_size }};
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_redirect {{ nginx_proxy_redirect }};
proxy_buffering {{ nginx_proxy_buffering }};
proxy_connect_timeout {{ nginx_proxy_connect_timeout }};
proxy_read_timeout {{ nginx_proxy_read_timeout }};
proxy_send_timeout {{ nginx_proxy_send_timeout }};
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
location /{{ context }} {
proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
}
{% endfor %}
{% endfor %}
location {{ dataminer_52north_webapp_context }} {
proxy_pass http://localhost:{{ item.http_port }}{{ dataminer_52north_webapp_context }};
}
}

View File

@ -0,0 +1 @@
dataminer1-d-d4s.d4science.org-virtualhost.j2

View File

@ -0,0 +1 @@
dataminer1-d-d4s.d4science.org-virtualhost.j2

View File

@ -0,0 +1 @@
dataminer1-p-d4s.d4science.org-virtualhost.j2

View File

@ -0,0 +1 @@
dataminer1-d-d4s.d4science.org-virtualhost.j2

View File

@ -0,0 +1,58 @@
server {
listen {{ http_port }};
server_name {{ item.servername }};
access_log on;
# This is the default for nginx on Ubuntu 12.04
root /usr/share/nginx/www/;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# don't send the nginx version number in error pages and Server header
server_tokens off;
# Proxy stuff
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffer_size {{ nginx_proxy_buffer_size }};
proxy_buffers {{ nginx_proxy_buffers }};
proxy_busy_buffers_size {{ nginx_proxy_busy_buffers_size }};
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_redirect {{ nginx_proxy_redirect }};
proxy_buffering {{ nginx_proxy_buffering }};
proxy_connect_timeout {{ nginx_proxy_connect_timeout }};
proxy_read_timeout {{ nginx_proxy_read_timeout }};
proxy_send_timeout {{ nginx_proxy_send_timeout }};
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
location /{{ context }} {
proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
}
{% endfor %}
{% endfor %}
{% if smart_executor_install %}
location {{ smart_executor_context }} {
proxy_pass http://localhost:{{ item.http_port }}{{ smart_executor_context }};
}
{% endif %}
}

View File

@ -0,0 +1,139 @@
server {
listen {{ http_port }};
{% if letsencrypt_acme_install is defined and letsencrypt_acme_install %}
location ^~ /.well-known/acme-challenge {
proxy_pass http://127.0.0.1:{{ letsencrypt_acme_standalone_port }}/.well-known/acme-challenge;
access_log /var/log/nginx/letsencrypt_access.log;
error_log /var/log/nginx/letsencrypt_error.log;
}
{% endif %}
{% if not http_ssl_enabled %}
server_name {{ ansible_fqdn }};
client_max_body_size 100M;
# This is the default for nginx on Ubuntu 14.04
root /usr/share/nginx/html/;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# don't send the nginx version number in error pages and Server header
server_tokens off;
# Proxy stuff
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffer_size {{ nginx_proxy_buffer_size }};
proxy_buffers {{ nginx_proxy_buffers }};
proxy_busy_buffers_size {{ nginx_proxy_busy_buffers_size }};
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_redirect {{ nginx_proxy_redirect }};
proxy_buffering {{ nginx_proxy_buffering }};
proxy_connect_timeout {{ nginx_proxy_connect_timeout }};
proxy_read_timeout {{ nginx_proxy_read_timeout }};
proxy_send_timeout {{ nginx_proxy_send_timeout }};
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
location /{{ context }} {
proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
}
{% endfor %}
{% endfor %}
location / {
proxy_pass http://localhost:{{ smartgears_http_port }};
}
{% else %}
return 301 https://{{ ansible_fqdn }}$request_uri;
{% endif %}
}
{% if http_ssl_enabled %}
server {
listen {{ https_port }} ssl;
server_name {{ ansible_fqdn }};
client_max_body_size 100M;
access_log /var/log/nginx/access_ssl.log;
error_log /var/log/nginx/error_ssl.log;
# This is the default for nginx on Ubuntu 14.04
root /usr/share/nginx/html/;
ssl_certificate {{ letsencrypt_acme_certs_dir }}/fullchain;
ssl_certificate_key {{ letsencrypt_acme_certs_dir }}/privkey;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA";
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# don't send the nginx version number in error pages and Server header
server_tokens off;
# Proxy stuff
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffer_size {{ nginx_proxy_buffer_size }};
proxy_buffers {{ nginx_proxy_buffers }};
proxy_busy_buffers_size {{ nginx_proxy_busy_buffers_size }};
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_redirect {{ nginx_proxy_redirect }};
proxy_buffering {{ nginx_proxy_buffering }};
proxy_connect_timeout {{ nginx_proxy_connect_timeout }};
proxy_read_timeout {{ nginx_proxy_read_timeout }};
proxy_send_timeout {{ nginx_proxy_send_timeout }};
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
location /{{ context }} {
proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
}
{% endfor %}
{% endfor %}
location / {
proxy_pass http://localhost:{{ smartgears_http_port }};
}
}
{% endif %}

View File

@ -0,0 +1,50 @@
---
gcube_repository: 'gcube-staging'
gcube_repository_stagin_test: 'gcube-staging-test'
# Set it to true from the command line when you want to upgrade a
# distribution version
smartgears_upgrade: False
smartgears_force_install: False
smartgears_node: True
smartgears_install_generic_virthost: True
smartgears_data_fs: /home
smartgears_user: '{{ d4science_user }}'
smartgears_user_home: '{{ d4science_user_home }}'
smartgears_instance_path: '{{ smartgears_user_home }}/tomcat'
smartgears_install_path: '{{ smartgears_user_home }}/SmartGears'
#smartgears_distribution_version: 1.2.6-3.10.0
#smartgears_distribution_version: 1.2.7-3.10.1
smartgears_distribution_version: 1.2.7-3.11.0-125799
smartgears_file: 'smartgears-distribution-{{ smartgears_distribution_version }}.tar.gz'
smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/distribution/smartgears-distribution/{{ smartgears_distribution_version }}/{{ smartgears_file }}'
smartgears_mode: online
# Production infra and VO
smartgears_infrastructure_name: "d4science.research-infrastructures.eu"
smartgears_vo_name: gCubeApps
smartgears_hostname: '{{ ansible_fqdn }}'
smartgears_country: it
smartgears_location: pisa
smartgears_http_port: 9000
smartgears_service_name: 'tomcat-instance-{{ smartgears_http_port }}'
# The iptables rules use this
http_port: '{{ smartgears_http_port }}'
tomcat_m_webapps_unpack: True
tomcat_m_instances:
- { http_enabled: True, http_port: '{{ smartgears_http_port }}', http_address: '0.0.0.0', ajp_enabled: False, ajp_port: '8109', ajp_address: '127.0.0.1', restart_timeout: '{{ tomcat_m_restart_timeout }}', shutdown_port: '-1', java_home: '{{ jdk_java_home }}', user: '{{ smartgears_user }}', user_home: '{{ smartgears_user_home }}', user_shell: '{{ tomcat_m_default_user_shell }}', instance_path: '{{ smartgears_instance_path }}', max_threads: '{{ tomcat_m_max_threads }}', autodeploy: '{{ tomcat_m_webapps_autodeploy }}', unpack: '{{ tomcat_m_webapps_unpack }}', default_conf: True, java_opts: '{{ tomcat_m_java_opts }}', java_gc_opts: '{{ tomcat_m_java_gc_opts }}', other_java_opts: '{{ tomcat_m_other_java_opts }}', remote_debugging: '{{ tomcat_m_enable_remote_debugging }}', remote_debugging_port: '{{ smartgears_debugging_port }}' , access_log_enabled: True, log_rotation_freq: daily, log_retain: 30, allowed_hosts: [ '0.0.0.0/0' ], app_contexts: [ 'whn-manager' ], servername: '{{ ansible_fqdn }}' }
# To enable debugging:
# - Set
# tomcat_m_enable_remote_debugging: True
# Rerun the playbook using --tags=tomcat_default
#
smartgears_debugging_port: '{{ tomcat_m_remote_debugging_port }}'
# iptables:
# tcp_rules: True
# tcp:
# - { port: '{{ smartgears_debugging_port }}', allowed_hosts: [ '{{ network.isti }}', '{{ network.nmis }}', '{{ network.eduroam }}' ] }

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,3 @@
---
- include: smartgears-app.yml

View File

@ -0,0 +1,71 @@
---
- name: Remove the smartgears distribution archive to force un upgrade
file: dest={{ item }} state=absent
with_items:
- '{{ smartgears_user_home }}/{{ smartgears_file }}'
- '{{ smartgears_user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}'
when: smartgears_force_install
tags: [ 'smartgears', 'tomcat' ]
- name: Get the smartgears distribution
get_url: url={{ smartgears_url }} dest={{ smartgears_user_home }}/{{ smartgears_file }}
register: new_smartgears_distribution
tags: [ 'smartgears', 'tomcat' ]
- name: Unarchive the smartgears distribution
become: True
become_user: '{{ d4science_user }}'
unarchive: copy=no src={{ smartgears_user_home }}/{{ smartgears_file }} dest={{ smartgears_user_home }} creates={{ smartgears_user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}
when: ( new_smartgears_distribution | changed )
tags: [ 'smartgears', 'tomcat' ]
- name: Stop the smartgears container before launching the upgrade script
become: True
become_user: '{{ d4science_user }}'
shell: /home/{{ d4science_user }}/stopContainer.sh
when: smartgears_upgrade
tags: [ 'smartgears', 'tomcat', 'stop_smartgears_service' ]
- name: Install the additional tomcat default file
template: src=tomcat-instance-default.j2 dest=/etc/default/tomcat-instance-{{ item.http_port }}.local
with_items: '{{ tomcat_m_instances }}'
notify: Restart smartgears
tags: [ 'smartgears', 'tomcat', 'smartgears_env' ]
- name: Set the additional tomcat default file as the smartgears user .bashrc
become: True
become_user: '{{ d4science_user }}'
template: src=tomcat-instance-default.j2 dest={{ item.user_home }}/.bashrc mode=0444
with_items: '{{ tomcat_m_instances }}'
tags: [ 'smartgears', 'tomcat', 'smartgears_env' ]
- name: Install the smartgears app
shell: cd {{ item.user_home }}/smartgears-distribution-{{ smartgears_distribution_version }} ; . /{{ item.user_home }}/.bashrc ; ./install -s tomcat ; chown -R gcube:gcube smartgears-distribution-{{ smartgears_distribution_version }} SmartGears/ tomcat/lib/ tomcat/webapps/
with_items: '{{ tomcat_m_instances }}'
when: ( new_smartgears_distribution | changed )
register: install_smartgears_app
notify: Restart smartgears
tags: [ 'smartgears', 'tomcat' ]
- name: Install the smartgears configuration file
template: src=container.xml.j2 dest={{ smartgears_install_path }}/container.xml owner={{ item.user }} group={{ item.user }}
with_items: '{{ tomcat_m_instances }}'
when: not generic_worker_install
register: containerxml_state
notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]
- name: Remove the smartgears application state if the configuration changed
file: dest={{ smartgears_install_path }}/state state=absent
when: ( containerxml_state | changed )
notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]
- name: Remove some wrong symbolic links created by the install/upgrade script
file: dest={{ smartgears_install_path }}/state state=absent
with_items:
- '{{ smartgears_install_path }}/lib/lib'
- '{{ smartgears_install_path }}/apps/webapps'
when: smartgears_upgrade
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]

View File

@ -0,0 +1,27 @@
<container mode='{{ smartgears_mode }}'>
<hostname>{{ smartgears_hostname }}</hostname>
{%if setup_nginx %}
{%if https_port is defined %}
<port>{{ https_port }}</port>
{% else %}
<port>{{ http_port }}</port>
{% endif %}
{% else %}
<port>{{ item.http_port }}</port>
{% endif %}
<infrastructure>{{ smartgears_infrastructure_name }}</infrastructure>
<vo>{{ smartgears_vo_name }}</vo>
<site>
<country>{{ smartgears_country }}</country>
<location>{{ smartgears_location }}</location>
<latitude>41.9000</latitude>
<longitude>12.5000</longitude>
</site>
<property name='SmartGearsDistributionBundle' value='UnBundled' />
<property name='SmartGearsDistribution' value='{{ smartgears_distribution_version }}' />
<publication-frequency>60</publication-frequency>
</container>

View File

@ -0,0 +1,2 @@
export GHN_HOME={{ smartgears_user_home }}/SmartGears
export WEB_CONTAINER_HOME={{ smartgears_instance_path }}

View File

@ -0,0 +1,4 @@
---
- include: setup-egi-image.yml
when: egi_image

View File

@ -0,0 +1,9 @@
---
- name: Install the EGI image setup script
template: src=smartgears-setup.sh.j2 dest=/usr/local/bin/smartgears-setup owner=root group=root mode=0555
tags: [ 'smartgears', 'tomcat', 'egi', 'egi_image' ]
- name: Install the EGI gcube keys installer script
template: src=get-gcube-keys.sh.j2 dest=/usr/local/bin/get-gcube-keys owner=root group=root mode=0500
tags: [ 'smartgears', 'tomcat', 'egi', 'egi_image' ]

View File

@ -0,0 +1,43 @@
#!/bin/bash
SM_DIR={{ smartgears_install_path }}
SM_LIB_DIR=${SM_DIR}/lib
# The dataminer wants the gcube keys in a different directory too
SM_DATAMINER_PARALLEL_PROC={{ smartgears_user_home }}/tomcat/webapps/wps/ecocfg/PARALLEL_PROCESSING
LOG_FILE=/var/log/smartgears-gcubekeys-setup.log
INFRA_NAME=$1
> $LOG_FILE
if [ ! -d $SM_LIB_DIR ] ; then
echo "$0: The lib directory: $SM_LIB_DIR does not exist, aborting" >> $LOG_FILE
exit 1
else
pushd $SM_LIB_DIR >/dev/null 2>&1
fi
if [ "$INFRA_NAME" == "gcube" ] ; then
wget {{ gcube_dkey_1 }} --no-check-certificate -o /dev/null -O gcube.gcubekey
wget {{ gcube_dkey_2 }} --no-check-certificate -o /dev/null -O devsec.gcubekey
wget {{ gcube_dkey_3 }} --no-check-certificate -o /dev/null -O devNext.gcubekey
elif [ "$INFRA_NAME" == "d4science.research-infrastructures.eu" ] ; then
wget {{ gcube_pkey_1 }} --no-check-certificate -o /dev/null -O d4science.research-infrastructures.eu.gcubekey
wget {{ gcube_pkey_2 }} --no-check-certificate -o /dev/null -O FARM.gcubekey
wget {{ gcube_pkey_3 }} --no-check-certificate -o /dev/null -O gCubeApps.gcubekey
chmod 400 $SM_LIB_DIR/*.gcubekey
else
echo "The Infra name is unknown, no keys downloaded" >> $LOG_FILE
exit 0
fi
popd >/dev/null 2>&1
chmod 400 $SM_LIB_DIR/*.gcubekey >> $LOG_FILE 2>&1
chown gcube:root $SM_LIB_DIR/*.gcubekey >> $LOG_FILE 2>&1
if [ -d $SM_DATAMINER_PARALLEL_PROC ] ; then
echo "This is a dataminer. Copy the keys inside the dataminer conf dir" >> $LOG_FILE 2>&1
cp -a $SM_LIB_DIR/*.gcubekey $SM_DATAMINER_PARALLEL_PROC >> $LOG_FILE 2>&1
chmod 400 $SM_DATAMINER_PARALLEL_PROC/*.gcubekey >> $LOG_FILE 2>&1
chown gcube:root $SM_DATAMINER_PARALLEL_PROC/*.gcubekey >> $LOG_FILE 2>&1
fi
exit 0

View File

@ -0,0 +1,106 @@
#!/bin/bash
SM_DIR={{ smartgears_install_path }}
SM_CONF_F=${SM_DIR}/container.xml
SM_LIB_DIR=${SM_DIR}/lib
SM_STATE_DIR=${SM_DIR}/state/
GET_KEYS_SCRIPT=/usr/local/bin/get-gcube-keys
SVC=tomcat-instance-{{ smartgears_http_port }}
LOG_FILE=/var/log/smartgears-node-setup.log
HOSTS_FILE=/etc/hosts
FQDN_HOST=
PUB_FQDN_HOST=
PUBLIC_IP=
MAIN_IP=
RETVAL=0
{% raw %}
> $LOG_FILE
if [ -z "${HOST}" ] ; then
echo "No hostname was passed from the outside. Trying to find it out by ourselves" >> $LOG_FILE
FQDN_HOST=$( /bin/hostname -f )
if [ -z "${FQDN_HOST}" ] ; then
echo "The machine has no FQDN. Revert to plain hostname" >> $LOG_FILE
HOST=$( /bin/hostname )
echo "Setting the plain hostname: $HOST" >> $LOG_FILE
else
HOST=$FQDN_HOST
fi
fi
# We don't know if we have been assigned a private or public IP address
PUBLIC_IP=$( wget http://ipecho.net/plain -qO - )
MAIN_IP=$( ip addr show scope global dev eth0 | grep inet | awk '{ print $2 }' | cut -d "/" -f 1 )
echo "Our main IP is ${MAIN_IP}" >> $LOG_FILE
if [ -z $PUBLIC_IP ] ; then
# We have some kind of problem
echo "We cannot obtain our public IP from outside. Using our main IP address as public IP" >> $LOG_FILE
PUBLIC_IP=$MAIN_IP
else
echo "Our public IP is ${PUBLIC_IP}" >> $LOG_FILE
fi
# Try to know our public FQDN
TMP_FQDN_HOST=$( host $PUBLIC_IP )
RET_FQDN=$?
if [ $RET_FQDN -eq 0 ] ; then
PUB_FQDN_HOST=$( host $PUBLIC_IP | awk '{print $5}' | sed -e 's/\.$//g' )
fi
# Set the hosts file with the new data
grep -v $HOST $HOSTS_FILE > $HOSTS_FILE.tmp
echo "${PUBLIC_IP} ${FQDN_HOST} ${PUB_FQDN_HOST} ${HOST}" >> $HOSTS_FILE.tmp
mv $HOSTS_FILE.tmp $HOSTS_FILE
chmod 644 $HOSTS_FILE
chown root:root $HOSTS_FILE
if [ -z "${INFRA_NAME}" ] ; then
echo "The infrastructure name is void" >> $LOG_FILE
RETVAL=1
fi
if [ -z "${SCOPE}" ] ; then
echo "The scope is void" >> $LOG_FILE
RETVAL=1
fi
if [ -z "${COUNTRY}" ] ; then
echo "The country code is void" >> $LOG_FILE
RETVAL=1
elif [ ${#COUNTRY} -ne 2 ] ; then
echo "The country code is wrong. It must be two characters long" >> $LOG_FILE
RETVAL=1
fi
if [ $RETVAL -eq 1 ] ; then
echo "Exiting because of errors. The SmartExecutor will not start" >> $LOG_FILE
exit 1
fi
# We use the public FQDN if there's one. Otherwise we use the public IP
if [ ! -z ${PUB_FQDN_HOST} ] ; then
sed -i -e "s#@SMARTGEARS_HOSTNAME@#${PUB_FQDN_HOST}#g" $SM_CONF_F
else
sed -i -e "s#@SMARTGEARS_HOSTNAME@#${PUBLIC_IP}#g" $SM_CONF_F
fi
sed -i -e "s#@SMARTGEARS_INFRASTRUCTURE_NAME@#${INFRA_NAME}#g" $SM_CONF_F
sed -i -e "s#@SMARTGEARS_VO_NAME@#${SCOPE}#g" $SM_CONF_F
sed -i -e "s#@SMARTGEARS_COUNTRY@#${COUNTRY}#g" $SM_CONF_F
sed -i -e "s#@SMARTGEARS_LOCATION@#${LOCATION}#g" $SM_CONF_F
{% endraw %}
# Get and install the gcube security keys
if [ -x $GET_KEYS_SCRIPT ] ; then
echo "Getting the infrastructure keys" >> $LOG_FILE
$GET_KEYS_SCRIPT ${INFRA_NAME} >> $LOG_FILE
rm -f $GET_KEYS_SCRIPT
echo "Done" >> $LOG_FILE
else
echo "Not getting the infrastructure keys, the script is not available." >> $LOG_FILE
fi
/etc/init.d/${SVC} stop
rm -fr ${SM_STATE_DIR}/*
rm -f ${SM_DIR}/ghn.log
sleep 20
/usr/sbin/update-rc.d ${SVC} enable
/etc/init.d/${SVC} start
exit 0

View File

@ -0,0 +1,7 @@
---
gcube_repository: 'gcube-staging'
social_data_indexer_se_plugin_install: False
#social_data_indexer_se_plugin_ver: 1.0.0-3.11.0-124419
social_data_indexer_se_plugin_ver: 1.0.0-3.11.0-125977
social_data_indexer_se_plugin_name: 'social-data-indexer-se-plugin-{{ social_data_indexer_se_plugin_ver }}-jar-with-dependencies.jar'
social_data_indexer_se_plugin_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/socialnetworking/social-data-indexer-se-plugin/{{ social_data_indexer_se_plugin_ver }}/{{ social_data_indexer_se_plugin_name }}'

View File

@ -0,0 +1,3 @@
---
- name: Restart smartgears
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted

View File

@ -0,0 +1,9 @@
---
- name: Get the couchdb cache se plugin and install it inside the smart executor
become: True
become_user: '{{ smartgears_user }}'
get_url: url={{ social_data_indexer_se_plugin_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
when: social_data_indexer_se_plugin_install
notify: Restart smartgears
tags: [ 'smartgears', 'social_data_indexer_se', 'tomcat' ]