add new storagehub role

helper-playbooks/fix-dataminer-ecological-engine.yml add new helper playbook for fix ecological-engine library
group_vars/nlp/nlp.yml add new key on nlp
roles/smartgears-conf/tasks/smartgears-app.yml add new task for forcing the container stop
This commit is contained in:
Roberto Cirillo 2018-05-23 12:00:16 +02:00
parent e4a40a2ae1
commit a7bce47097
6 changed files with 320 additions and 0 deletions

View File

@ -0,0 +1,99 @@
---
storage_hub_install: False
storage_hub_upgrade: False
storage_hub_version: 1.0.0-4.11.1-167555
storage_hub_name: storagehub
storage_hub_group_id: org.gcube.data.access
storage_hub_extension: war
storage_hub_file: '{{ storage_hub_name }}-{{ storage_hub_version }}.{{ storage_hub_extension }}'
# storagehub.xml context mapping
storagehub_config_file_path: '{{ smartgears_instance_path }}/{{ jackrabbit_repository_config }}'
storagehub_rep_home_dir: '{{ smartgears_instance_path }}/jackrabbit/workspaces'
admin_pwd: "{{ vault_admin_pass }}"
# Standard jackrabbit configuration
#
jackrabbit_data_dir: /data/jackrabbit
jackrabbit_config_files:
- bootstrap.properties
- repository.xml
jackrabbit_rmi_enabled: 'true'
jackrabbit_rmi_host: 'localhost'
jackrabbit_rmi_port: 0
jackrabbit_repository_config: 'jackrabbit/repository.xml'
jackrabbit_repository_name: 'jackrabbit.repository'
jackrabbit_jndi_enabled: 'true'
jackrabbit_db_type: 'postgresql'
jackrabbit_db_driver: 'org.postgresql.Driver'
jackrabbit_db_host: 'localhost'
jackrabbit_virt_fs_db_type: '{{ jackrabbit_db_type }}'
jackrabbit_virt_fs_db_schema: '{{ jackrabbit_db_type }}'
jackrabbit_virt_fs_db_driver: '{{ jackrabbit_db_driver }}'
jackrabbit_virt_fs_db_host: '{{ jackrabbit_db_host }}'
jackrabbit_virt_fs_db_name: 'workspace-db'
jackrabbit_virt_fs_db_user: 'workspace-db-user'
#jackrabbit_virt_fs_db_password: ''
jackrabbit_virt_fs_db_url: 'jdbc:{{ jackrabbit_virt_fs_db_type }}://{{ jackrabbit_virt_fs_db_host }}/{{ jackrabbit_virt_fs_db_name }}'
# By default the data store uses the same database of the virtual filesystem
jackrabbit_data_store_db_type: '{{ jackrabbit_db_type }}'
jackrabbit_data_store_db_schema: '{{ jackrabbit_db_type }}'
jackrabbit_data_store_db_driver: '{{ jackrabbit_db_driver }}'
jackrabbit_data_store_db_host: '{{ jackrabbit_db_host }}'
jackrabbit_data_store_db_name: '{{ jackrabbit_virt_fs_db_name }}'
jackrabbit_data_store_db_user: '{{ jackrabbit_virt_fs_db_user }}'
jackrabbit_data_store_db_password: '{{ jackrabbit_virt_fs_db_password }}'
jackrabbit_data_store_db_url: 'jdbc:{{ jackrabbit_data_store_db_type }}://{{ jackrabbit_data_store_db_host }}/{{ jackrabbit_data_store_db_name }}'
jackrabbit_data_store_db_tableprefix: 'datastore_'
jackrabbit_security_adminid: 'jr_admin'
#jackrabbit_security_admin_pwd: ''
jackrabbit_ws_default_workspace: 'default'
jackrabbit_ws_persistence_manager: 'org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager'
jackrabbit_ws_persistence_manager_db_type: '{{ jackrabbit_db_type }}'
jackrabbit_ws_persistence_manager_db_schema: '{{ jackrabbit_db_type }}'
jackrabbit_ws_persistence_manager_db_driver: '{{ jackrabbit_db_driver }}'
jackrabbit_ws_persistence_manager_db_host: '{{ jackrabbit_db_host }}'
jackrabbit_ws_persistence_manager_db_name: '{{ jackrabbit_virt_fs_db_name }}'
jackrabbit_ws_persistence_manager_db_user: '{{ jackrabbit_virt_fs_db_user }}'
jackrabbit_ws_persistence_manager_db_password: '{{ jackrabbit_virt_fs_db_password }}'
jackrabbit_ws_persistence_manager_db_url: 'jdbc:{{ jackrabbit_ws_persistence_manager_db_type }}://{{ jackrabbit_ws_persistence_manager_db_host }}/{{ jackrabbit_ws_persistence_manager_db_name }}'
jackrabbit_ws_persistence_manager_db_tableprefix: 'pm_${wsp.name}_'
jackrabbit_ver_persistence_manager: 'org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager'
jackrabbit_ver_persistence_manager_db_type: '{{ jackrabbit_db_type }}'
jackrabbit_ver_persistence_manager_db_schema: '{{ jackrabbit_db_type }}'
jackrabbit_ver_persistence_manager_db_driver: '{{ jackrabbit_db_driver }}'
jackrabbit_ver_persistence_manager_db_host: '{{ jackrabbit_db_host }}'
jackrabbit_ver_persistence_manager_db_name: '{{ jackrabbit_virt_fs_db_name }}'
jackrabbit_ver_persistence_manager_db_user: '{{ jackrabbit_virt_fs_db_user }}'
jackrabbit_ver_persistence_manager_db_password: '{{ jackrabbit_virt_fs_db_password }}'
jackrabbit_ver_persistence_manager_db_url: 'jdbc:{{ jackrabbit_ver_persistence_manager_db_type }}://{{ jackrabbit_ver_persistence_manager_db_host }}/{{ jackrabbit_ver_persistence_manager_db_name }}'
jackrabbit_ver_persistence_manager_db_tableprefix: 'pm_version_'
# Cluster configuration. Same db host by default, different DB
jackrabbit_cluster_db_host: '{{ jackrabbit_db_host }}'
jackrabbit_cluster_db_type: '{{ jackrabbit_db_type }}'
jackrabbit_cluster_db_schema: '{{ jackrabbit_db_type }}'
jackrabbit_cluster_db_driver: '{{ jackrabbit_db_driver }}'
jackrabbit_cluster_db_name: 'ws-db-cluster-journal'
jackrabbit_cluster_db_user: 'ws-db-journal-user'
# jackrabbit_cluster_db_password: ''
jackrabbit_cluster_db_url: 'jdbc:{{ jackrabbit_cluster_db_type }}://{{ jackrabbit_cluster_db_host }}/{{ jackrabbit_cluster_db_name }}'
jackrabbit_cluster_db_tableprefix: 'journal_'
jackrabbit_cluster_node_id: '{{ ansible_fqdn }}'
# Set it to true if we want to clean the journal daily
jackrabbit_cluster_janitor_enabled: 'false'

View File

@ -0,0 +1,70 @@
---
- block:
- name: Remove the installed home library/ storagehub when we do not want it installed
file: dest={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}.war'
- '{{ smartgears_instance_path }}/webapps/{{ storage_hub_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ storage_hub_name }}.war'
notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'
when: not storage_hub_install
tags: [ 'smartgears', 'storage_hub', 'tomcat' ]
- block:
- maven_artifact: artifact_id={{ storage_hub_name }} version={{ storage_hub_version | default(omit) }} group_id={{ storage_hub_group_id }} extension={{ storage_hub_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ storage_hub_file }}
register: storage_hub_download
- name: Remove the installed storage hub before upgrading
file: dest={{ smartgears_instance_path }}/webapps/{{ storage_hub_name }} state=absent
when: ( storage_hub_download | changed )
notify: Restart smartgears
- name: Get the StorageHub war
maven_artifact: artifact_id={{ storage_hub_name }} version={{ storage_hub_ver | default('latest') }} group_id={{ storage_hub_group_id }} extension={{ storage_hub_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ storage_hub_file }}
register: storage_hub_download
- name: Create the storage_hub webapp directory
file: dest={{ smartgears_instance_path }}/webapps/{{ storage_hub_name }} state=directory
when: storage_hub_download
- name: Unarchive the storage_hub war file
unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ storage_hub_file }} dest={{ smartgears_instance_path }}/webapps/{{ storage_hub_name }}
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ storage_hub_name }}/WEB-INF/web.xml'
notify: Restart smartgears
- name: Install the storage_hub web.xml template
template: src=storage-hub-web.xml.j2 dest={{ smartgears_instance_path }}/webapps/{{ storage_hub_name }}/WEB-INF/web.xml mode=0440
notify: Restart smartgears
- name: Create the JackRabbit persistence directory
become_user: root
file: dest={{ jackrabbit_data_dir }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Verify if the JackRabbit persistence directory is in the place where the service expects it
stat: path={{ smartgears_instance_path }}/jackrabbit
register: jackrabbit_data_path
- name: Link the data dir to the place where jackrabbit expects it
file: src={{ jackrabbit_data_dir }} dest={{ smartgears_instance_path }}/jackrabbit state=link
when: not jackrabbit_data_path.stat.exists
- name: Install the repository configuration files
template: src={{ item }}.j2 dest={{ jackrabbit_data_dir }}/{{ item }}
with_items: '{{ jackrabbit_config_files }}'
notify: Restart smartgears
# - name: Install the additional service context default file
# template: src=storagehub.xml.j2 dest={{ smartgears_instance_path }}/conf/Catalina/localhost/storagehub.xml mode=0664
# notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'
when: storage_hub_install
tags: [ 'smartgears', 'storage_hub', 'tomcat' ]

View File

@ -0,0 +1,11 @@
#bootstrap properties for the repository startup servlet.
#Fri Jul 21 05:19:29 CEST 2017
java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory
repository.home=jackrabbit
rmi.enabled={{ jackrabbit_rmi_enabled }}
repository.config={{ jackrabbit_repository_config }}
repository.name={{ jackrabbit_repository_name }}
rmi.host={{ jackrabbit_rmi_host }}
java.naming.provider.url=http\://www.apache.org/jackrabbit
jndi.enabled={{ jackrabbit_jndi_enabled }}
rmi.port={{ jackrabbit_rmi_port }}

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN" "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
<Repository>
<!-- virtual file system where the repository stores global state (e.g.
registered namespaces, custom node types, etc.) -->
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="{{ jackrabbit_virt_fs_db_driver }}" />
<param name="schema" value="{{ jackrabbit_virt_fs_db_schema }}" />
<param name="url" value="{{ jackrabbit_virt_fs_db_url }}" />
<param name="user" value="{{ jackrabbit_virt_fs_db_user }}" />
<param name="password" value="{{ jackrabbit_virt_fs_db_password }}" />
<param name="schemaObjectPrefix" value="rep_" />
</FileSystem>
<!-- data store configuration -->
<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
<param name="driver" value="{{ jackrabbit_data_store_db_driver }}" />
<param name="databaseType" value="{{ jackrabbit_data_store_db_type }}" />
<param name="url" value="{{ jackrabbit_data_store_db_url }}" />
<param name="user" value="{{ jackrabbit_data_store_db_user }}" />
<param name="password" value="{{ jackrabbit_data_store_db_password }}" />
<param name="minRecordLength" value="1024" />
<param name="maxConnections" value="3" />
<param name="copyWhenReading" value="true" />
<param name="tablePrefix" value="{{ jackrabbit_data_store_db_tableprefix }}" />
<param name="schemaObjectPrefix" value="" />
</DataStore>
<!-- security configuration -->
<Security appName="Jackrabbit">
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" />
<AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager" />
<LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
<param name="adminId" value="{{ jackrabbit_security_adminid }}" />
<param name="adminPassword" value="{{ jackrabbit_security_admin_pwd }}" />
</LoginModule>
</Security>
<!-- location of workspaces root directory and name of default workspace -->
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="{{ jackrabbit_ws_default_workspace }}" />
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}" />
</FileSystem>
<PersistenceManager class="{{ jackrabbit_ws_persistence_manager }}">
<param name="driver" value="{{ jackrabbit_ws_persistence_manager_db_driver }}" />
<param name="url" value="{{ jackrabbit_ws_persistence_manager_db_url }}" />
<param name="schema" value="{{ jackrabbit_ws_persistence_manager_db_schema }}" />
<param name="user" value="{{ jackrabbit_ws_persistence_manager_db_user }}" />
<param name="password" value="{{ jackrabbit_ws_persistence_manager_db_password }}" />
<param name="schemaObjectPrefix" value="{{ jackrabbit_ws_persistence_manager_db_tableprefix }}" />
<param name="bundleCacheSize" value="600" />
<param name="errorHandling" value="IGNORE_MISSING_BLOBS" />
<param name="consistencyFix" value="false" />
<param name="consistencyCheck" value="false" />
</PersistenceManager>
<!-- Search index and the file system it uses. class: FQN of class implementing
the QueryHandler interface -->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index" />
<param name="supportHighlighting" value="true" />
<param name="autoRepair" value="true" />
<param name="onWorkspaceInconsistency" value="log" />
<param name="indexingConfiguration" value="${rep.home}/indexing_configuration.xml" />
<param name="resultFetchSize" value="50" />
<param name="cacheSize" value="100000" />
<param name="enableConsistencyCheck" value="false" />
<param name="forceConsistencyCheck" value="false" />
</SearchIndex>
</Workspace>
<!-- Configures the versioning -->
<Versioning rootPath="${rep.home}/version">
<!-- Configures the filesystem to use for versioning for the respective
persistence manager -->
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/version" />
</FileSystem>
<PersistenceManager class="{{ jackrabbit_ver_persistence_manager }}">
<param name="driver" value="{{ jackrabbit_ver_persistence_manager_db_driver }}" />
<param name="url" value="{{ jackrabbit_ver_persistence_manager_db_url }}" />
<param name="schema" value="{{ jackrabbit_ver_persistence_manager_db_schema }}" />
<param name="user" value="{{ jackrabbit_ver_persistence_manager_db_user }}" />
<param name="password" value="{{ jackrabbit_ver_persistence_manager_db_password }}" />
<param name="schemaObjectPrefix" value="{{ jackrabbit_ver_persistence_manager_db_tableprefix }}" />
<param name="bundleCacheSize" value="600" />
<param name="consistencyFix" value="false" />
<param name="consistencyCheck" value="false" />
</PersistenceManager>
</Versioning>
<!-- Cluster configuration -->
<Cluster id="{{ jackrabbit_cluster_node_id }}" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
<param name="driver" value="{{ jackrabbit_cluster_db_driver }}" />
<param name="url" value="{{ jackrabbit_cluster_db_url }}" />
<param name="databaseType" value="{{ jackrabbit_cluster_db_type }}" />
<param name="schemaObjectPrefix" value="{{ jackrabbit_cluster_db_tableprefix }}" />
<param name="user" value="{{ jackrabbit_cluster_db_user }}" />
<param name="password" value="{{ jackrabbit_cluster_db_password }}" />
<param name="revision" value="${rep.home}/revision.log" />
<param name="janitorEnabled" value="{{ jackrabbit_cluster_janitor_enabled }}"/> <!-- set to true if you want to daily clean the journal table https://wiki.apache.org/jackrabbit/Clustering#Removing_Old_Revisions -->
</Journal>
</Cluster>
</Repository>

View File

@ -0,0 +1,19 @@
<web-app>
<context-param>
<param-name>admin-username</param-name>
<param-value>{{ jackrabbit_security_adminid }}</param-value>
</context-param>
<context-param>
<param-name>admin-pwd</param-name>
<param-value>{{ admin_pwd }}</param-value>
</context-param>
<servlet>
<servlet-name>org.gcube.data.access.storagehub.StorageHub</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>org.gcube.data.access.storagehub.StorageHub</servlet-name>
<url-pattern>/workspace/*</url-pattern>
</servlet-mapping>
</web-app>

View File

@ -0,0 +1,11 @@
<Context path="/storagehub">
<Resource
name="jcr/repository"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="'{{ storagehub_config_file_path }}'"
repHomeDir="'{{ storagehub_rep_home_dir }}'"
/>
</Context>