Skip to content

Commit

Permalink
Merge pull request #122 from idealista/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sorobon authored Jun 2, 2020
2 parents 6b2cc8a + 848b9a4 commit c7b1b8b
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ tests/__pycache__
.vagrant
.cache
.python-version
.idea
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ All notable changes to this project will be documented in this file.

## [Unreleased](https://github.com/idealista/solrcloud_role/tree/develop)

## [2.5.0](https://github.com/idealista/solrcloud_role/tree/2.5.0) (2020-06-02)
### Added
- *[#112](https://github.com/idealista/solrcloud_role/issues/112) Support for package management* @sorobon

## [2.4.1](https://github.com/idealista/solrcloud_role/tree/2.4.1) (2020-05-25)
### Changed
- *[#107](https://github.com/idealista/solrcloud_role/issues/107) Default naven repository using https instead of http*
- *[#107](https://github.com/idealista/solrcloud_role/issues/107) Default naven repository using https instead of http* @sorobon
- *Bump ansible version to 2.8.8* @sorobon
- *[#110](https://github.com/idealista/solrcloud_role/issues/110) Role fully compatible with solr 8.5.1* @sorobon
- *[#109](https://github.com/idealista/solrcloud_role/issues/109) Migration to molecule 3.x* @sorobon
- *[#113](https://github.com/idealista/solrcloud_role/issues/113) Rename role to solrcloud_role* @sorobon
- *[#112](https://github.com/idealista/solrcloud_role/issues/112) Improve agents management* @sorobon
- *[#117](https://github.com/idealista/solrcloud_role/issues/117) Support for debian buster* @sorobon
### Fixed
- *[#106](https://github.com/idealista/solrcloud_role/issues/106) Extra space in SOLR_ULIMIT_CHECKS var in solr.in.sh.j2*
- *[#106](https://github.com/idealista/solrcloud_role/issues/106) Extra space in SOLR_ULIMIT_CHECKS var in solr.in.sh.j2* @sorobon
### Removed
- *Only one molecule test with all options*
- *Only one molecule test with all options* @sorobon

## [2.4.0](https://github.com/idealista/solrcloud_role/tree/2.4.0) (2019-11-20)
### Added
Expand Down
24 changes: 21 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

## General
solr_version: 8.5.1
solr_version: 8.5.2
solrcloud_install: true

## Service options
Expand Down Expand Up @@ -44,7 +44,8 @@ solr_log_slow_queries_file_name: solr_slow_requests.log
# Ports
solr_host: "{{ hostvars[ansible_nodename]['ansible_' + ansible_default_ipv4.alias]['ipv4']['address'] }}"
solr_port: 8983
solr_url: http://{{ solr_host }}:{{ solr_port }}/solr
solr_node_base_url: "http://{{ solr_host }}:{{ solr_port }}"
solr_url: "{{ solr_node_base_url }}/solr"
solr_jmx_enabled: 'true'
solr_jmx_port: 1099

Expand All @@ -63,7 +64,9 @@ solr_gc_tune: "-XX:NewRatio=3 \
-XX:CMSMaxAbortablePrecleanTime=6000 \
-XX:+CMSParallelRemarkEnabled \
-XX:+ParallelRefProcEnabled \
-XX:+UseTLAB"
-XX:+UseTLAB
-Denable.packages=true"

solr_stack_size: 256k
solr_heap: 512m

Expand Down Expand Up @@ -102,6 +105,21 @@ solr_collections_template_path: "{{ playbook_dir }}/templates/collections/"
solr_external_libraries_repository_url: https://repo1.maven.org/maven2
solr_external_libraries: {}

## Example
# solr_external_libraries:
# - artifact_id: jts-core
# group_id: org.locationtech.jts
# version: 1.16.0

solr_external_packages_repository_url: https://repo1.maven.org/maven2
solr_external_packages_tmp_dir: "{{ solr_tmp_basedir }}"
solr_external_packages: {}
## Example
# solr_external_packages:
# - artifact_id: simpleclient
# group_id: io.prometheus
# version: 0.9.0

solr_ulimit_checks: true

solr_metrics:
Expand Down
5 changes: 5 additions & 0 deletions molecule/default/group_vars/solrcloud/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ solr_external_libraries:
group_id: org.locationtech.jts
version: 1.16.0

solr_external_packages:
- artifact_id: simpleclient
group_id: io.prometheus
version: 0.9.0

solr_collections:
# Extracted from https://github.com/apache/lucene-solr/tree/master/solr/server/solr/configsets/sample_techproducts_configs/conf
# Should have configuration files under "templates/collections/[collection_name]" directory
Expand Down
6 changes: 6 additions & 0 deletions molecule/default/tests/test_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ file:
exists: true
filetype: file
{% endfor %}
{% for pkg in solr_external_packages %}
{{ solr_data_dir }}/filestore/{{ pkg.artifact_id }}/{{ pkg.version }}/{{ pkg.artifact_id }}-{{ pkg.version }}.jar:
exists: true
filetype: file
{% endfor %}


port:
tcp:{{ solr_port }}:
Expand Down
13 changes: 10 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: SolrCloud | Install
import_tasks: install.yml
tags:
- install
- solr_install

- name: SolrCloud | Agent config
import_tasks: agent.yml
Expand All @@ -19,11 +19,18 @@
- name: SolrCloud | Service
import_tasks: service.yml
tags:
- service
- solr_service

- name: SolrCloud | Manage packages
import_tasks: packages.yml
when: solr_external_packages is defined and solr_external_packages|length > 0
run_once: true
tags:
- solr_packages

- name: SolrCloud | Manage collections
import_tasks: collections.yml
when: solr_collections is defined and solr_collections|length > 0
run_once: true
tags:
- collections
- solr_collections
29 changes: 29 additions & 0 deletions tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

- name: SolrCloud | Packages | Install maven_artifact module required packages
apt:
package: "{{ solr_packages_libraries_required_packages }}"
state: present
notify: restart SolrCloud
when: solr_external_libraries is defined and solr_external_libraries|length > 0

- name: SolrCloud | Packages | Download external libraries
maven_artifact:
group_id: "{{ item.group_id }}"
artifact_id: "{{ item.artifact_id }}"
version: "{{ item.version }}"
repository_url: "{{ solr_external_packages_repository_url }}"
dest: "{{ solr_external_packages_tmp_dir }}"
mode: 0644
with_items: "{{ solr_external_packages }}"
when: solr_external_packages is defined and solr_external_packages|length > 0

- name: SolrCloud | Packages | Upload external libs
uri:
url: "{{ solr_node_base_url }}/api/cluster/files/{{ item.artifact_id }}/{{ item.version }}/{{ item.artifact_id }}-{{ item.version }}.jar"
method: PUT
src: "{{ solr_external_packages_tmp_dir }}/{{ item.artifact_id }}-{{ item.version }}.jar"
remote_src: true
with_items: "{{ solr_external_packages }}"
ignore_errors: true
changed_when: false
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ solr_cloud_url: "http://archive.apache.org/dist/lucene/solr/{{ solr_version }}/{
solr_external_libraries_destination_path: "{{ solr_installation_dir }}/server/solr-webapp/webapp/WEB-INF/lib/"
solr_external_libraries_required_packages:
- python-lxml
solr_packages_libraries_required_packages:
- curl

0 comments on commit c7b1b8b

Please sign in to comment.