This patch adds the java_home variable to all supported
operating systemd, and gives the user the option to
set it themselves. It also updates config.pp to
ensure that the JAVA_HOME variable is set to
the desired java_home.
Exposed the Puppet 'package' resource's 'install_options' parameter via a new class parameter names 'package_options*. It takes an array of strings to pass installation options to the package provider of the targer OS (yum, apt-get, ...)
Added validation of $package_options array
Using stdlib' validate_array function to ensure that $package_options is a valid array (also if just empty).
Cleaned array validation line
Made $package_options undef by default
Class parameter $package_options is now set to undef by default, validation is done in the class to ensure only an array would be passed to it if set.
Added case for 'package_options' parameter
Will test the use of the 'package_options' parameter being passed the YUM option --downloadonly which will see YUM return 0 but package will not be installed on system.
Simplified test of 'package_options' parameter
As the test 'select openjdk for Fedora 21 without installing' expects with a successful YUM run but the 'java' package not present, specifying package version is irrelevant.
New case for complete installation with YUM option
Added new case using 'package_options' with a a YUM option expected to not prevent rpm installation.
Also added distribution parameter for test of 'pacakge_options' with yum option expected to prevent package installation.
Removed validation of package name
Removed validation of package name as it is not meant to be testing by 'select passed value for Fedora 21 with yum option'
Removed test with '--downloadonly'
The test of 'package_options* with the YUM option '---downloadonly' can't seem to be validate in CI.
Other test 'select passed value for Fedora 21 with yum option' covers passing a value to 'package_options* and passes test in CI.
* Note this won't work by default on FreeBSD Puppet < 4.0, as pkgng is not the default provider
* On older Puppet, use `zleslie/pkgng`, on newer it's the default package provider.
Add info about OpenBSD support to README.md and metadata.json
Add a note about OpenBSD java_version fact to README.markdown.
Fixup wording on context in one of the java patch level regression tests.
No mentioning of OpenBSD in metdata.json
Cleanup wording of context as suggested by @elyscape
update contexts as suggested by @elyscape
In some cases it can cause problems and report these kind of errors:
$ update-java-alternatives -s /usr/lib/jvm/java-1.7.0-openjdk-amd64 --jre
update-alternatives: error: no alternatives for policytool
update-alternatives: error: no alternatives for policytool
The main motivation for this change is for compatibility with puppetresource (https://github.com/bartavelle/language-puppet).
IMHO, it makes much more sense this way because all cases are checked order wise.