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 2011-05-25 Jeff McCune <jeff@puppetlabs.com> - 0.1.1
* Re-did versioning to follow semantic versioning * Re-did versioning to follow semantic versioning

View File

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

View File

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