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.
[Amazon Linux AMI](https://aws.amazon.com/cn/amazon-linux-ami/2016.09-release-notes/) is another RedHat-like os image, openjdk-7 was shipped in that image but we want more choices or jdk 8. i'd been tested ok for oracle jdk installation on a 't2.micro' instance.
We are having issues on reboot of boxes. It tries to download to tmp even though already installed, which would be fine,
but the version is no longer available.
This results in curl downloading something to tmp every time puppet runs, which eventualy fills up tmp :(
* Allow targeting specific major/minor Oracle JDK versions
Expose two new parameters 'version_major' and 'version_minor' to
allow users targeting specific Oracle JDK versions.
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
* Fix lint validation issues
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
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>
The previous make-jpkg from java-package_0.50 doesn't support building java
versions with three digits in the release number. Therefore it has been
necessary to upgrade java-packaages to the newer 0.53 version.
Building oracle packages using the java-package tools 0.53 results in package
with a new naming scheme as compared to 0.50. In particular where the packages
were previously named oracle-j2re1.8 they are now named oracle-java8-jre, while
oracle-j2dk1.8 has become oracle-java8-jdk. The alternatives naming has also
changed.
We also need to handle the system architecture naming on debian systems where
Debian names it's 64bit architecture 'amd64' and Oracle use 'x64'. This results
in the java_home path using x64 rather than amd64. We need to handle this
variation while also accommodating all architectures, and only for the recent
packages.
Given this has only been tested on Ubuntu, and the make-jpkg tooling is managed
in the Debian flavour, the changes are only applied to that code branch.
Jinn Koriech & Doug Neal
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.