Compare commits

...

3 Commits
0.1.1 ... 0.1.2

Author SHA1 Message Date
Jeff McCune
d93930d6e3 Update CHANGELOG to 0.1.2 2011-05-26 11:31:33 -07:00
Jeff McCune
b3eb1642ae Merge branch 'comment/master/jre_vs_jdk'
* comment/master/jre_vs_jdk:
  Change jre and jdk booleans to a single string
2011-05-26 11:31:23 -07:00
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
3 changed files with 21 additions and 20 deletions

View File

@@ -1,3 +1,6 @@
2011-05-26 Jeff McCune <jeff@puppetlabs.com> - 0.1.2
* Changes JRE/JDK selection class parameter to $distribution
2011-05-25 Jeff McCune <jeff@puppetlabs.com> - 0.1.1
* Re-did versioning to follow semantic versioning

View File

@@ -1,5 +1,5 @@
name 'puppetlabs-java'
version '0.1.1'
version '0.1.2'
source 'git://github.com/puppetlabs/puppetlabs-java'
author 'puppetlabs'
license 'Apache'

View File

@@ -12,33 +12,31 @@
#
# [Remember: No empty lines between comments and class definition]
class java(
$jre = false,
$jdk = true,
$version='1.6.0_25-fcs'
$distribution = 'jdk',
$version = 'installed'
) {
# Cannot pass anonymous arrays to functions in 2.6.8
$v_true_false = [ '^true$', '^false$' ]
$v_distribution = [ '^jre$', '^jdk$' ]
# Must compare string values, not booleans.
validate_re("$jre", $v_true_false)
validate_re("$jdk", $v_true_false)
validate_re($version, '^[._0-9a-zA-Z:-]+$')
validate_re($distribution, $v_distribution)
$jre_real = $jre
$jdk_real = $jdk
$version_real = $version
$version_real = $version
$distribution_real = $distribution
if $jre_real {
class { 'java::jre_package':
version => $version_real,
stage => 'runtime',
case $distribution_real {
jre: {
class { 'java::jre_package':
version => $version_real,
stage => 'runtime',
}
}
}
if $jdk_real {
class { 'java::jdk_package':
version => $version_real,
stage => 'runtime',
jdk: {
class { 'java::jdk_package':
version => $version_real,
stage => 'runtime',
}
}
}