Merge branch 'ticket/master/X_debian_support'

* ticket/master/X_debian_support:
  Bump stdlib module dependency to 0.1.6
  Update README for apt and rpm based platforms.
  Update the module example test manifest
  Add Debian based distro support.
This commit is contained in:
Jeff McCune
2011-06-16 18:57:57 -07:00
6 changed files with 121 additions and 13 deletions

View File

@@ -8,4 +8,4 @@ description 'Manage the official Java runtime'
project_page 'https://github.com/puppetlabs/puppetlabs-java' project_page 'https://github.com/puppetlabs/puppetlabs-java'
## Add dependencies, if any: ## Add dependencies, if any:
dependency 'puppetlabs/stdlib', '>= 0.1.3' dependency 'puppetlabs/stdlib', '>= 0.1.6'

View File

@@ -2,7 +2,14 @@
Manage the Java runtime for use with other application software. Manage the Java runtime for use with other application software.
Currently this simply deploys the package on Enterprise Linux based systems. Currently this simply deploys the package on Enterprise Linux based systems and Debian based systems.
Tested on:
* Centos 5.6
* Ubuntu 10.04 Lucid
# RedHat Support #
The Java runtime this module is designed to configure are the RPM's provided by Oracle and obtained by extracting them from the "bin" installers. The Java runtime this module is designed to configure are the RPM's provided by Oracle and obtained by extracting them from the "bin" installers.
@@ -14,3 +21,13 @@ Please download the installer from:
* [Java Downloads](http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html) * [Java Downloads](http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html)
# Ubuntu Support #
## Lucid ##
You need to have the partner repository enabled in order to install the Sun JDK or JRE.
aptitude install python-software-properties
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
aptitude update

View File

@@ -16,18 +16,44 @@ class java(
$version = 'installed' $version = 'installed'
) { ) {
# Cannot pass anonymous arrays to functions in 2.6.8 validate_re($distribution, '^jdk$|^jre$')
$v_distribution = [ '^jre$', '^jdk$' ] validate_re($version, 'installed|^[._0-9a-zA-Z:-]+$')
# Must compare string values, not booleans.
validate_re($version, '^[._0-9a-zA-Z:-]+$')
validate_re($distribution, $v_distribution)
$version_real = $version anchor { 'java::begin': }
$distribution_real = $distribution 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: {
$distribution_debian = $distribution ? {
jdk => 'sun-java6-jdk',
jre => 'sun-java6-jre',
}
class { 'java::package_debian':
version => $version,
distribution => $distribution_debian,
require => Anchor['java::begin'],
before => Anchor['java::end'],
}
}
default: {
fail("operatingsystem $operatingsystem is not supported")
}
package { 'java':
ensure => $version_real,
name => "${distribution_real}",
} }
} }

View File

@@ -0,0 +1,28 @@
# Class: java::package_debian
#
# Implementation class of the Java package
# for debian based systems.
#
# This class is not meant to be used by the end user
# of the module. It is an implementation class
# of the composite Class[java]
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class java::package_debian(
$version,
$distribution
) {
package { 'java':
ensure => $version,
name => $distribution,
}
}

View File

@@ -0,0 +1,28 @@
# Class: java::package_redhat
#
# Implementation class of the Java package
# for redhat based systems.
#
# This class is not meant to be used by the end user
# of the module. It is an implementation class
# of the composite Class[java]
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class java::package_redhat(
$version,
$distribution
) {
package { 'java':
ensure => $version,
name => $distribution,
}
}

View File

@@ -1 +1,10 @@
include java node default {
notify { "alpha": } ->
class { 'java':
distribution => 'jdk',
version => 'latest',
} ->
notify { "omega": }
}