-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
install.yml
73 lines (67 loc) · 2.11 KB
/
install.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
---
- name: Ensure dependencies are installed.
package:
name:
- lsof
- acl
- sudo
state: present
- name: Ensure service wrapper is installed for RHEL 9+.
package:
name:
- initscripts-service
- chkconfig
state: present
when:
- ansible_service_mgr == 'systemd'
- ansible_os_family == 'RedHat'
- ansible_distribution_version.split(".")[0] >= '9'
- name: Ensure service wrapper is installed for RHEL 7 & 8.
package:
name:
- initscripts
- chkconfig
state: present
when:
- ansible_service_mgr == 'systemd'
- ansible_os_family == 'RedHat'
- ansible_distribution_version.split(".")[0] <= '8'
- name: Ensure service wrapper is installed for Debian-based distributions.
package:
name: init-system-helpers
state: present
when:
- ansible_service_mgr == 'systemd'
- ansible_os_family == 'Debian'
# We add '-n' to Solr versions beyond 6.3.0 to prevent autostart on install.
- name: Run Solr installation script.
command: >
{{ solr_workspace }}/{{ solr_filename }}/bin/install_solr_service.sh
{{ solr_workspace }}/{{ solr_filename }}.tgz
-i {{ solr_install_dir }}
-d {{ solr_home }}
-u {{ solr_user }}
-s {{ solr_service_name }}
-p {{ solr_port }}
{{ (solr_version is version('6.3.0', '>=')) | ternary('-n','') }}
{{ (solr_version is version('5.4.0', '>=')) | ternary('-f','') }}
creates={{ solr_install_path }}/bin/solr
register: solr_install_script_result
# Workaround for bug https://github.com/ansible/ansible-modules-core/issues/915.
- name: Ensure solr is stopped (RHEL 7+ workaround).
command: service {{ solr_service_name }} stop
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_version.split(".")[0] >= '7'
- solr_install_script_result.changed
failed_when: false
tags: ['skip_ansible_lint']
- name: Run systemd daemon_reload (RHEL 7+ workaround).
systemd:
name: solr
daemon_reload: true
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_version.split(".")[0] >= '7'
- solr_install_script_result.changed
tags: ['skip_ansible_lint']