-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
main.yml
59 lines (48 loc) · 1.51 KB
/
main.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
---
- include: user.yml
when: solr_create_user
- name: Set solr_filename for Solr 4+.
set_fact:
solr_filename: "solr-{{ solr_version }}"
when: "solr_version.split('.')[0] >= '4'"
- name: Set solr_filename for Solr 3.x.
set_fact:
solr_filename: "apache-solr-{{ solr_version }}"
when: "solr_version.split('.')[0] == '3'"
- name: Check if Solr has been installed already.
stat:
path: "{{ solr_install_path }}"
register: solr_install_path_status
- name: Download Solr.
get_url:
url: "{{ solr_mirror }}/lucene/solr/{{ solr_version }}/{{ solr_filename }}.tgz"
dest: "{{ solr_workspace }}/{{ solr_filename }}.tgz"
force: no
when: solr_install_path_status.stat.isdir is not defined
register: solr_download_status
- name: Expand Solr.
unarchive:
src: "{{ solr_workspace }}/{{ solr_filename }}.tgz"
dest: "{{ solr_workspace }}"
copy: no
when: solr_download_status.changed
# Install Solr < 5.
- include: install-pre5.yml
when: "solr_version.split('.')[0] < '5'"
# Install Solr 5+.
- include: install.yml
when: "solr_version.split('.')[0] >= '5'"
- name: Ensure solr is started and enabled on boot if configured.
service:
name: "{{ solr_service_name }}"
state: "{{ solr_service_state }}"
enabled: yes
when: solr_service_manage
# Configure solr.
- include: configure.yml
when: "solr_version.split('.')[0] >= '5'"
# Create cores, if any are configured.
- include: cores.yml
when: "solr_cores and solr_version.split('.')[0] >= '5'"
- include: trim-fat.yml
static: no