Files
puppetlabs-java/manifests/init.pp
Jeff McCune 867f8c524a Change jre and jdk booleans to a single string
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.
2011-05-26 11:29:17 -07:00

44 lines
853 B
Puppet

# Class: java
#
# This module manages the Java runtime package
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# [Remember: No empty lines between comments and class definition]
class java(
$distribution = 'jdk',
$version = 'installed'
) {
# Cannot pass anonymous arrays to functions in 2.6.8
$v_distribution = [ '^jre$', '^jdk$' ]
# Must compare string values, not booleans.
validate_re($version, '^[._0-9a-zA-Z:-]+$')
validate_re($distribution, $v_distribution)
$version_real = $version
$distribution_real = $distribution
case $distribution_real {
jre: {
class { 'java::jre_package':
version => $version_real,
stage => 'runtime',
}
}
jdk: {
class { 'java::jdk_package':
version => $version_real,
stage => 'runtime',
}
}
}
}