Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pre5 systemd configuration #81

Closed
wants to merge 4 commits into from
Closed

Fix pre5 systemd configuration #81

wants to merge 4 commits into from

Conversation

jonathonwalz
Copy link
Contributor

Currently, installing 3 or 4 is completely broken on a systemd based system (at least, with the default configuration). This adds testing the older versions on newer OSes to the travis build and fixes the systemd configuration. Additionally, it will stops installing the unneeded /etc/init.d/ based configs on a system using systemd.

I believe this is a fix for #57 and is an alternative to #56.

Testing Solr on the newer versions of the OSes breaks the Java
installation on OSes that do not supported the older version of the
package. Since the java role has sensible defaults for various OS
versions this simply doesn't set a version so the default is used -
except debian 9. Debian 9 doesn't correct get java 8 but 7 is attempted
to be installed. So the test still overrides the java package for >
debian 8.

The apt cache needs to be updated as well due to a behavior difference
in the newer version of apt and ansible. It appears that ansible
currently incorrectly updates the apt cache in earlier OS versions so
the java installs wwere working correctly. In the newer versions,
however, trying to install java results in a package not found error due
to the empty cache.
Solr 3/4 do not provide the /bin/solr binary to use. Instead they use
start.jar file with jetty. This switches to using a simple systemd unit
to manage the process without it backgrounding itself.

It also stops doing tasks that are useless/unneeded on systems that use
systemd.
@longwave
Copy link
Contributor

+1 for merging this, I am running various old Solr versions on CentOS 7 and these builds stopped working recently but switching to this branch fixes them again. In the meantime I have added this to my requirements.yml:

- src: https://github.com/jonathonwalz/ansible-role-solr
  version: fix-pre5-systemd
  name: geerlingguy.solr

@danepowell
Copy link

Confirming that Solr 4.5.1 is broken in DrupalVM using later Ubuntu images. Can we get this merged?

@geerlingguy
Copy link
Owner

Ugh, Solr 4.5... how much I hate supporting years-old unsupported releases :P

I promise I'll try to take a look at this PR soon.

@@ -34,3 +34,9 @@ solr_restart_handler_enabled: true
# Used only for Solr < 5.
solr_log_file_path: /var/log/solr.log
solr_host: "0.0.0.0"

solr_use_systemd: >
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a newer variable, I forget exactly what it's called, but it can be used as a simple flag to show whether the OS is using systemd or not... I'd rather do that then set up a hash of all these values here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,14 +0,0 @@
[Unit]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still used for newer versions? I don't remember at a glance.

- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == "Debian"
- name: Set Java 8 package for Debian > 8.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a blank newline between tasks.

- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == "Debian"
- name: Set Java 8 package for Debian > 8.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a blank newline between tasks.

@geerlingguy
Copy link
Owner

Cleaned up and rebased in #97

@geerlingguy geerlingguy closed this Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants