Files
puppetlabs-java/manifests/init.pp
Cody Herriges d027d35e2d Fixing a couple style discrepancies.
Update a couple minor style things that were noticed while making previous
  changes.
2012-05-09 15:47:48 -07:00

74 lines
1.5 KiB
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 = 'present'
) {
validate_re($distribution, '^jdk$|^jre$|^java.*$')
validate_re($version, 'installed|^[._0-9a-zA-Z:-]+$')
anchor { 'java::begin': }
anchor { 'java::end': }
case $operatingsystem {
centos, redhat, oel: {
class { 'java::package_redhat':
version => $version,
distribution => $distribution,
require => Anchor['java::begin'],
before => Anchor['java::end'],
}
}
debian, ubuntu: {
case $lsbdistcodename {
squeeze, lucid: {
$distribution_debian = $distribution ? {
jdk => 'openjdk-6-jdk',
jre => 'openjdk-6-jre-headless',
}
}
wheezy, precise: {
$distribution_debian = $distribution ? {
jdk => 'openjdk-7-jdk',
jre => 'openjdk-7-jre-headless',
}
}
default: {
fail("operatingsystem distribution ${lsbdistcodename} is not supported")
}
}
class { 'java::package_debian':
version => $version,
distribution => $distribution_debian,
require => Anchor['java::begin'],
before => Anchor['java::end'],
}
}
default: {
fail("operatingsystem ${operatingsystem} is not supported")
}
}
}