Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 49f1a3d

Browse files
committed
Fixes #1518: Update Solr role to work better with really old Solr versions under systemd.
1 parent 75f9074 commit 49f1a3d

File tree

8 files changed

+54
-31
lines changed

8 files changed

+54
-31
lines changed

provisioning/requirements.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- src: geerlingguy.php-tideways
5757
version: 2.1.0
5858
- src: geerlingguy.php-versions
59-
version: 2.1.2
59+
version: 2.1.3
6060
- src: geerlingguy.php-xdebug
6161
version: 2.5.0
6262
- src: geerlingguy.php-xhprof
@@ -76,6 +76,6 @@
7676
- src: geerlingguy.security
7777
version: 1.7.0
7878
- src: geerlingguy.solr
79-
version: 4.1.0
79+
version: 4.2.0
8080
- src: geerlingguy.varnish
8181
version: 2.3.0

provisioning/roles/geerlingguy.php-versions/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
- name: Include OS-specific variables.
33
include_vars: "{{ item }}"
44
with_fileglob:
5-
- "../vars/{{ ansible_os_family }}.yml"
6-
- "../vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
5+
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
6+
- "{{ role_path }}/vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
77

88
- name: Define PHP variables.
99
set_fact: "{{ item.key }}={{ hostvars[inventory_hostname][item.value] }}"

provisioning/roles/geerlingguy.solr/.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ env:
1717
playbook: test-solr-6.yml
1818
- distro: debian9
1919
playbook: test-solr-6.yml
20+
- distro: ubuntu1604
21+
playbook: test-solr-4.yml
22+
- distro: ubuntu1604
23+
playbook: test-solr-3.yml
2024
- distro: ubuntu1404
2125
playbook: test-solr-5.yml
22-
- distro: ubuntu1204
23-
playbook: test-solr-5.yml
2426
- distro: ubuntu1404
2527
playbook: test-solr-4.yml
2628
- distro: ubuntu1404

provisioning/roles/geerlingguy.solr/tasks/install-pre5.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,26 @@
5858
group: root
5959
mode: 0664
6060
changed_when: false
61+
when: ansible_service_mgr != 'systemd'
6162

6263
- name: Copy solr init script into place.
6364
template:
6465
src: "solr-init-{{ ansible_os_family }}-pre5.j2"
6566
dest: "/etc/init.d/{{ solr_service_name }}"
6667
mode: 0755
68+
when: ansible_service_mgr != 'systemd'
6769

6870
- name: Ensure daemon is installed (Debian).
6971
apt: name=daemon state=present
70-
when: ansible_os_family == "Debian"
72+
when:
73+
- ansible_os_family == "Debian"
74+
- ansible_service_mgr != 'systemd'
7175

7276
- name: Copy solr systemd unit file into place (for systemd systems).
7377
template:
74-
src: solr.unit.j2
78+
src: solr-pre5.unit.j2
7579
dest: /etc/systemd/system/solr.service
7680
owner: root
7781
group: root
7882
mode: 0755
79-
when: >
80-
(ansible_distribution == 'Ubuntu' and ansible_distribution_version == '16.04') or
81-
(ansible_distribution == 'Debian' and ansible_distribution_version|int >= 8) or
82-
(ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 7) or
83-
(ansible_distribution == 'Fedora')
83+
when: ansible_service_mgr == 'systemd'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Apache SOLR
3+
After=syslog.target network.target remote-fs.target nss-lookup.target
4+
5+
[Service]
6+
Type=simple
7+
WorkingDirectory={{ solr_install_path }}/example
8+
ExecStart=/usr/bin/java -jar -Dsolr.solr.home={{ solr_home }} -Djetty.host={{ solr_host }} -Djetty.port={{ solr_port }} -Xms{{ solr_xms }} -Xmx{{ solr_xmx }} start.jar
9+
Restart=on-failure
10+
User=solr
11+
12+
[Install]
13+
WantedBy=multi-user.target

provisioning/roles/geerlingguy.solr/templates/solr.unit.j2

Lines changed: 0 additions & 14 deletions
This file was deleted.

provisioning/roles/geerlingguy.solr/tests/test-solr-3.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,19 @@
33

44
vars:
55
solr_version: "3.6.2"
6-
java_packages:
7-
- openjdk-7-jdk
6+
7+
pre_tasks:
8+
- name: Update apt cache.
9+
apt: update_cache=yes cache_valid_time=600
10+
when: ansible_os_family == "Debian"
11+
12+
- name: Set Java 8 package for Debian > 8.
13+
set_fact:
14+
java_packages:
15+
- openjdk-8-jdk
16+
when:
17+
- ansible_distribution == "Debian"
18+
- ansible_distribution_version|int > 8
819

920
roles:
1021
- geerlingguy.java

provisioning/roles/geerlingguy.solr/tests/test-solr-4.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@
44
vars:
55
solr_version: "4.10.4"
66
solr_remove_cruft: true
7-
java_packages:
8-
- openjdk-7-jdk
7+
8+
pre_tasks:
9+
- name: Update apt cache.
10+
apt: update_cache=yes cache_valid_time=600
11+
when: ansible_os_family == "Debian"
12+
13+
- name: Set Java 8 package for Debian > 8.
14+
set_fact:
15+
java_packages:
16+
- openjdk-8-jdk
17+
when:
18+
- ansible_distribution == "Debian"
19+
- ansible_distribution_version|int > 8
920

1021
roles:
1122
- geerlingguy.java

0 commit comments

Comments
 (0)