michaelklishin/cassandra-chef-cookbook — pull request #118 by ti-mo (2014-10-07 13:46:22+00:00)
Title: Made all Java includes conditional

Ran into the following issue:

* The dsc20 rpm in the Datastax repo has a faulty dependency on jdk6. dsc20 and dsc21 need jdk7 to run.
* This jdk6 rpm installs itself with an update-alternatives priority of 16000, overruling most default setups. Installing this rpm manually on a clean CentOS installation without this cookbook also resulted in a broken Cassandra installation. (Unsupported major.minor version 51.0) I'll try to report this to the repo maintainer after.
* We run our own minimal Java cookbook (say 'timo-java') at the start of the Chef run using the same node attrs and update-alternatives JVM target path as the official 'java' cookbook. 'timo-java' sets the update-alternatives prio to 20000 to make sure our Java is master.
* Because this Cassandra cookbook is only included much later in the run and 'java' is always included, this overwrites the update-alternatives prio of 'timo-java' with its chosen value, 1062, resulting in a default of jdk6.

Regardless of the fact that we're using a custom Java cookbook in our environment, I believe having a non-togglable 'java' include in the recipes below is an error. This trumps the user's expectations after setting node.cassandra.install_java to false (it did for me), so I hope this patch is an overall improvement to the user friendliness of the cookbook. (I love it so far!)

Cheers

Timo