Skip to content

punktDe/ansible-proserver-solr

Repository files navigation

ansible-proserver-solr

An Ansible role that sets up Apache Solr and Apache Tika on a Proserver

Downloads the defined versions of Solr and Tika from archive.apache.org and enables their respective services.

Dependencies

Background

This role deactivates the built-in FreeBSD rc.d services for Solr and Tika and does not interfere with their respective working directories (/var/solr, /var/solr/db, etc.).

Instead, it uses supervisord for service management, and works with the following folders:

Directory Description
/var/opt/solr/solr Solr working directory
/var/opt/solr/home Solr home
/var/opt/solr/tika Tika working directory
/var/log/solr-ansible Solr and Tika Logs

Configuration

The default configuration values can be found in defaults/main.yaml

solr.url

Default: empty

The URL for the Solr WebUI

solr:
  url: https://solr.example.com

solr.oauth2_proxy

Default: empty

The oauth2_proxy configuration that should be used for Solr WebUI authentiacation.

Should be defined under oauth2_proxy.$configuration e.g. oauth2_proxy.main or oauth2_proxy.solr

If empty, the WebUI will be publicly available, with no authentication.

solr:
  oauth2_proxy: main

solr.overwrite_home

Default: no

If enabled, will erase the Solr home directory (default: /var/opt/solr/home) on version change.

Use with caution – this will also remove all your cores and custom configurations for them.

solr:
  overwrite_home: yes

If disabled, it will still handle the solr.xml as followed:

In case solr.version is older than 9.x, it will comment out the following parameters in your solr.xml:

  • allowUrls
  • modules
  • zkCredentialsInjector
  • distributedClusterStateUpdates
  • distributedCollectionConfigSetExecution
  • minStateByteLenForCompression
  • stateCompressor
  • hideStackTrace

These configuration parameters are present in the default solr.xml file shipped with 9.x, but are incompatible with versions 8.x and older.

The commented out lines are marked with the text disabled by Ansible.

In case solr.version is 9.x or newer, the role will uncomment all config lines that contain the text disabled by Ansible.

solr.prefix

The directories for Solr and Tika

solr:
  prefix:
    bin: /var/opt/solr/solr
    home: /var/opt/solr/home
    tika: /var/opt/solr/tika
    logs: /var/log/solr-ansible

solr.version

Solr version to install. Make sure the version exists on either https://archive.apache.org/dist/lucene/solr/ (pre 9.x) or https://archive.apache.org/dist/solr/solr/ (9.x)

solr:
  version: 9.7.0

solr.tika.version

Tika version to install. Make sure the version exists on https://archive.apache.org/dist/tika

solr:
  tika:
    version: 3.0.0