forked from Islandora-Devops/islandora-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solr.yml
72 lines (63 loc) · 1.93 KB
/
solr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
- hosts: solr
become: yes
any_errors_fatal: true
roles:
- role: geerlingguy.java
when: "ansible_os_family == 'Debian'"
java_packages:
- openjdk-8-jdk
- role: geerlingguy.java
when: "ansible_os_family == 'RedHat'"
java_packages:
- java-1.8.0-openjdk
- geerlingguy.solr
tasks:
- name: Make tmp dir for solr config
file:
path: /tmp/solr_config
state: directory
tags: solr
- name: Unarchive solr config
unarchive:
src: http://{{ hostvars[groups['webserver'][0]].ansible_host }}:{{ apache_listen_port }}/solr_config.zip
dest: /tmp/solr_config
remote_src: yes
tags: solr
- name: Get solr config files to copy
command: "find /tmp/solr_config -type f"
register: files_to_copy
changed_when: false
until: files_to_copy is not failed
retries: 5
tags: solr
- name: Copy solr config files
copy:
src: "{{ item }}"
dest: "{{ solr_instance_conf_path }}"
owner: "{{ solr_user }}"
group: "{{ solr_user }}"
remote_src: True
with_items:
- "{{ files_to_copy.stdout_lines }}"
tags: solr
# https://www.drupal.org/project/search_api_solr/issues/3015993
- name: Set solr_install_path in solrcore.properties
lineinfile:
path: "{{ solr_instance_conf_path }}/solrcore.properties"
regexp: '^solr\.install\.dir=.*$'
line: solr.install.dir={{ solr_install_path }}
state: present
notify: restart solr
tags: solr
- name: Fetch a Solr query to warm up the application
uri:
url: http://{{ hostvars[groups['solr'][0]].ansible_host }}:8983/solr/{{ solr_cores[0] }}/select?q=warm
method: GET
return_content: yes
status_code: [200,412]
register: solr_webpage
until: solr_webpage.status == 200
retries: 20
delay: 3
tags: solr