Oracle appears to have changed the JDK URL structure starting with Java 8u121.
This update adds a hash to store the values used by Oracle's java download site
along with a case statement to lookup the proper key for the java release being
installed.
It appears that redhat 7 and variants no longer have
java-1.7.0-openjdk-$arch symlinks. All redhat 6/7's both 32 and 64 bit
seem to include a java-1.7.0 symlink though.
This provides a workaround to the issue of Oracle changing it's URL structure which breaks the dynamic URL building in the module.
It allows a complete URL to be passed as an alternative to one built by the logic in the module, and allows the rest of the module to function as expected when this situation is encountered.
Changes made to manifests/oracle.pp to pass URL in `url` parameter (if defined) to the `source` directive of the archive resource which fetches the installer package.
README.markdown has been updated to document the additional parameter, as well as a note added to known issues describing it's operation.
A test has been added to spec/defines/oracle_spec.rb to verify the correct package is present in the tmp archive location. The spec tests have passed and the revised workflow has been tested in a lab environment and found to be working.
puppet-archive, a puppetlabs-java dependency, is now using structured
facts on master. this commit changes the minimum number of facts from
legacy to structured so that spec tests continue to pass
Without this patch the Oracle based package installations fail due to missing dependency: the package. The package installation command is defined and applied before the archive resource downloads the remote file. This patch correctly applies the order of operations: download package, install package.
Previous value of 8M caused JVM to crash on servers with more then 40G of RAM
Tested on databases servers up to 1.5T of RAM, 12M seems to be sufficient
This commit changes the way the JAVA_HOME variable is added to
/etc/environment from using a file resource to using an exec
resource. This way we can avoid resource conflicts with the
file.
Signed-off-by: Nate Potter <ntpttr@gmail.com>
New versions of oracle java 8 >= 100 have an updated naming scheme. These
test cases validate the new conditional logic around this for Debian and
derivatives.
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.
* dirname containing base directory of java
* e.g. java binary is `${::java_default_home}/jre/bin/java`
* dirname containing `libjvm.so`
* Most people will use this for LD_LIBRARY_PATH
The other method for running which java doesn't work on OSX, as java is installed as an empty shim when not installed in the base OSX image:
```
vagrant:~ vagrant$ java
No Java runtime present, requesting install.
vagrant:~ vagrant$ /usr/libexec/java_home --failfast
Unable to find any JVMs matching version "(null)".
vagrant:~ vagrant$
```
We can use the `/usr/libexec/java_home --failfast` command to check if
java is actually present first.
Originally-by: Peter Souter <peter.souter@puppetlabs.com>
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
This patch uses `catalogue` instead of `subject` for the raise_error
matcher since `subject` is not evaluated the way it used to be. We also
unpin rspec-puppet.