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.
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 module in its previous incarnation was unnecessarily hard to read
and use. This commit applies the "params" pattern in order to more
clearly deliniate between logical variable selection and actual
declarative configuration.
This change separates the package resource into an implementation
class following the composite class pattern.
In addition, the _real variables have been removed to prevent
confusion.
The validation functions have been updated to support a more
clear regular expression.
The debian package names are different, so conditional logic
is required to set a debian based distro specific variable
for the Java distribution name.
While the puppet resources work, there is currently an issue
on Lucid where the package REQUIRES interactive installation
to accept the license agreement. This will need to be fixed
for fully automated deployment on apt based systems.
The top level java module was declaring classes depending on what Java
distribution is required. Similar to the issues encountered with
service and configuration class ordering, the composed classes did not
have an established relationship with other things that require the
module.
This change brings all resources into a single top level java class and
eliminates class composition within the module entirely.
The stages feature of stdlib is turning out to be more trouble than it's
worth. Integrating the changes from Cody and Gary results in the entire
mcollective class being in the main stage. We've already found is
preferable to have stages after main rather than before to avoid
dependency cycles. This only works if all modules use stages. The
first module to not use stages will create a cycle if it requires and
modules who do use stages and the stages come after main.
Dan raised the comment in the previous patch set that it doesn't make
sense to provide two options and four states when there are really only
two possibilities; install the jre or the jdk.
This change removes the jdk and jre class parameters and replaces them
with a single distribution parameters.
Anonymous arrays and comparing booleans does not work in 2.6.8 like they
do in master. In 2.6.8 we cannot compare a true / false variable to a
string inside of Ruby without forcing the function argument to be a
string.