buluma.solr

Ansible Role: Solr

This Ansible role installs Apache Solr on Linux systems.

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

Here’s a simple playbook example that shows how to use this role. It is taken from the converge.yml file and is tested every time there is a push, pull request, or release.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  pre_tasks:
    - name: Set Java 8 package for RedHat.
      ansible.builtin.set_fact:
        java_packages:
          - java-1.8.0-openjdk
      when: ansible_os_family == "RedHat"

    - name: Set Java 8 package for Ubuntu.
      ansible.builtin.set_fact:
        java_packages:
          - openjdk-8-jdk
      when: ansible_os_family == "Ubuntu"

    - name: Set Java 11 package for Debian.
      ansible.builtin.set_fact:
        java_packages:
          - openjdk-11-jdk
      when: ansible_os_family == "Debian"

    - name: Update apt cache.
      ansible.builtin.apt: update_cache=true cache_valid_time=600
      when: ansible_os_family == "Debian"

    - name: Install dependencies (Debian).
      ansible.builtin.apt:
        name:
          - openjdk-11-jre-headless
          - ca-certificates-java
        state: present
      when: ansible_distribution == "Debian"

  roles:
    - role: buluma.java
    - role: buluma.solr

You might need to prepare your machine before running this playbook. In Continuous Integration (CI), this is done using the prepare.yml:

---
- name: Prepare
  hosts: all
  gather_facts: false
  become: true

  roles:
    - role: buluma.bootstrap
    - role: buluma.java

You can also check this detailed guide for more information on using these roles.

Role Variables

You can find the default values for the variables in the defaults/main.yml:

---
solr_workspace: /root
solr_create_user: true
solr_user: solr
solr_group: "{{ solr_user }}"
solr_version: "8.11.2"
solr_mirror: "https://archive.apache.org/dist"
solr_remove_cruft: false
solr_service_manage: true
solr_service_name: solr
solr_service_state: started
solr_install_dir: /opt
solr_install_path: "/opt/{{ solr_service_name }}"
solr_home: "/var/{{ solr_service_name }}"
solr_connect_host: localhost
solr_port: "8983"
solr_xms: "256M"
solr_xmx: "512M"
solr_timezone: "UTC"
solr_cores:
  - collection1
solr_default_core_path: "{% if solr_version.split('.')[0] < '9' %}{{ solr_install_path }}/example/files/conf/{% else %}{{ solr_install_path }}/server/solr/configsets/_default/conf/{% endif %}"
solr_config_file: /etc/default/{{ solr_service_name }}.in.sh
solr_restart_handler_enabled: true
solr_log_file_path: /var/log/solr.log
solr_host: "0.0.0.0"

Requirements

Make sure to have the pip packages listed in the requirements.txt.

State of Used Roles

You can prepare your system using these additional roles:

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version
buluma.java Ansible Molecule Version

Context

This role works well with many related roles. You can find more information in the documentation for these roles.

Here’s a visual of the related roles:

dependencies

Compatibility

This role has been tested with the following container images:

Container Tags
EL 9, 8
Fedora all

You will need Ansible version 2.12 or higher to use this role.

If you encounter any issues, please submit them on GitHub.

Changelog

You can check the Role History for updates.

License

This role is licensed under Apache-2.0.

Author Information

Created by Shadow Walker.

Installa
ansible-galaxy install buluma.solr
Licenza
apache-2.0
Download
1.8k
Proprietario
DevOps Engineer