Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class jdktest (
$versions = $jdktest::params::versions,
) inherits jdktest::params {
$package_names = prefix($versions, 'openjdk')
validate_array($versions)
validate_array($package_names)
contain jdktest::install
}
class jdktest::install inherits jdktest {
if ! ($versions) {
fail("You didn't provide any jdk versions to be installed")
}
validate_array($versions)
validate_array($package_names)
package { $package_names:
ensure => present,
}
}
class jdktest::params {
$versions = [ '7' ]
}
class { 'jdktest':
versions => '7',
}
class { 'jdktest':
versions => [ '7' ],
}
class { "jdktest":
versions => [ '7', '8' ],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.