T2L.solr

Ansible Role: Apache Solr

Build Status

This role installs Apache Solr version 5 or higher on Ubuntu LTS.

Features of This Apache Solr Role

  • Fast Downloads: It attempts to download Solr from the nearest server. If that doesn't work, it defaults to an archive.
  • File Integrity Check: Ensures that the downloaded files are complete and uncorrupted.
  • OS Compatibility: Works only with Ubuntu versions 16.04, 18.04, and 20.04.
  • Testing: Uses Molecule 3 for testing.

Requirements

For the Control Machine

This role requires specific Ansible modules, so make sure your local machine meets these needs:

  • synchronize: This is used to copy main settings to the Solr data folder. It uses rsync, which must be installed on both the local and remote machines.
  • xml: This module reads responses from the Solr Admin API. It needs lxml >= 2.3.0 installed on the local machine. More details on installation can be found here.

For the Target Machine

  • Java: Since Solr runs on Java, it must be installed on the target machine. You can use the t2l.java role for this.

The role also needs several tools that will be automatically installed on the remote host:

  • curl and sed: To find the nearest Apache Solr server.
  • gpg: To verify the downloaded Solr package.
  • tar: To extract the downloaded Solr package.
  • rsync: To sync core settings.
  • lsof: Recommended for smoother starting/stopping of Solr.

Role Variables

Here are the available variables, along with their default values (for more details, check defaults/main.yml):

  • Solr User and Group: Defaults to solr:solr.

    solr_user: solr
    solr_group: "{{ solr_user }}"
    
  • Solr Version: The minimum version supported is 5.0.0.

    solr_version: 7.7.3
    
  • Port for Solr:

    solr_port: 8983
    
  • Download Directory for Solr:

    solr_download_dir: /tmp
    
  • Installation Directory for Solr:

    solr_install_dir: /opt
    
  • Data Directory for Solr:

    solr_data_dir: /var/solr
    
  • Cleanup Options:

    • To delete downloaded files after installation:
      solr_cleanup_downloads: true
      
    • To delete GPG keys and signature files after installation:
      solr_cleanup_gpg: true
      
  • List of Solr Cores to Set Up:

    • name: Name of the Solr core.
    • conf_path (optional): Path to the core configuration directory on the remote host. If not provided, default settings will be used.
    solr_cores: []
    

Example for Cores (remove square brackets):

solr_cores:
  - name: main
  - name: extra
    conf_path: /var/www/project/config/solr

Example Playbook

- hosts: all
  roles:
    - t2l.solr

License

MIT

Author Information

This role was created by Roman Paska from 2017 to 2021.

Changelog

You can find the changelog here.

Upgrade

Upgrade instructions are available here.

Informazioni sul progetto

Install Apache Solr.

Installa
ansible-galaxy install T2L.solr
Licenza
mit
Download
7.6k
Proprietario