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.
42 lines
793 B
Puppet
42 lines
793 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,
|
|
}
|
|
}
|
|
jdk: {
|
|
class { 'java::jdk_package':
|
|
version => $version_real,
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|