forked from yorkulibraries/yudl-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solr.yml
83 lines (72 loc) · 2.18 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
73
74
75
76
77
78
79
80
81
82
83
---
- hosts: solr
become: yes
any_errors_fatal: true
roles:
- role: geerlingguy.java
when: "ansible_os_family == 'Debian'"
java_packages:
- openjdk-11-jdk
- Islandora-Devops.tomcat8
- geerlingguy.solr
- Islandora-Devops.cantaloupe
tasks:
- name: ldconfig kakadu
command: "ldconfig /opt/kakadu/lib/Linux-x86-64"
when: env == "production"
- name: Make tmp dir for solr config
file:
path: /tmp/solr_config
state: directory
mode: 0700
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
ignore_errors: yes
tags: solr
- name: Copy solr config files
copy:
src: "{{ item }}"
dest: "{{ solr_instance_conf_path }}"
owner: "{{ solr_user }}"
group: "{{ solr_user }}"
mode: 0744
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
- name: tomcat9 restart tomcat9
service:
name: tomcat9
state: restarted
when: "'gamma' in inventory_hostname"