The top level java module was declaring classes depending on what Java distribution is required. Similar to the issues encountered with service and configuration class ordering, the composed classes did not have an established relationship with other things that require the module. This change brings all resources into a single top level java class and eliminates class composition within the module entirely.
34 lines
664 B
Puppet
34 lines
664 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
|
|
|
|
package { 'java':
|
|
ensure => $version_real,
|
|
name => "${distribution_real}",
|
|
}
|
|
|
|
}
|