diff --git a/smartgears/home_library/defaults/main.yml b/smartgears/home_library/defaults/main.yml index ac7e4e4..c0fc09e 100644 --- a/smartgears/home_library/defaults/main.yml +++ b/smartgears/home_library/defaults/main.yml @@ -7,3 +7,86 @@ home_library_name: home-library-webapp home_library_group_id: org.gcube.data.access home_library_extension: war home_library_file: '{{ home_library_name }}-{{ home_library_version }}.{{ home_library_extension }}' + +# Standard jackrabbit configuration +# +jackrabbit_data_dir: /data/jackrabbit + +jackrabbit_config_files: + - bootstrap.properties.txt + - 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: 'localhost' + +jackrabbit_cluster_db_type: '{{ jackrabbit_db_type }}' +jackrabbit_cluster_db_schema: '{{ jackrabbit_db_type }}' +jackrabbit_cluster_db_driver: '{{ jackrabbit_db_driver }}' +jackrabbit_cluster_db_host: '{{ jackrabbit_cluster_db_host }}' +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_' +# Set it to true if we want to clean the journal daily +jackrabbit_cluster_janitor_enabled: 'false' + + diff --git a/smartgears/home_library/tasks/main.yml b/smartgears/home_library/tasks/main.yml index c31a422..b48b8db 100644 --- a/smartgears/home_library/tasks/main.yml +++ b/smartgears/home_library/tasks/main.yml @@ -18,6 +18,15 @@ creates: '{{ smartgears_instance_path }}/webapps/{{ home_library_name }}/WEB-INF/lib' 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: Install the repository configuration files + template: src={{ item }}.j2 dest={{ jackrabbit_data_dir }}/{{ item }} + with_items: '{{ jackrabbit_config_files }}' + notify: Restart smartgears + become: True become_user: '{{ smartgears_user }}' when: home_library_install diff --git a/smartgears/home_library/templates/bootstrap.properties.txt.j2 b/smartgears/home_library/templates/bootstrap.properties.txt.j2 new file mode 100644 index 0000000..6dbe7b0 --- /dev/null +++ b/smartgears/home_library/templates/bootstrap.properties.txt.j2 @@ -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 }} diff --git a/smartgears/home_library/templates/repository.xml.j2 b/smartgears/home_library/templates/repository.xml.j2 new file mode 100644 index 0000000..5747bbc --- /dev/null +++ b/smartgears/home_library/templates/repository.xml.j2 @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +