Compare commits

...

9 Commits

Author SHA1 Message Date
Jeff McCune
8a7c2fce30 Update CHANGELOG for version 0.1.5 2011-06-16 18:59:07 -07:00
Jeff McCune
babdde5f02 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.
2011-06-16 18:57:57 -07:00
Jeff McCune
0b541605e1 Bump stdlib module dependency to 0.1.6
This change is required because the anchor resource type
is not available in versions of puppetlabs-stdlib < 0.1.6
2011-06-16 17:47:56 -07:00
Jeff McCune
8aa2053c9d Update README for apt and rpm based platforms.
Package management for Lucid requires the partner
repository to be enabled.  This change documents
that fact.
2011-06-16 17:45:11 -07:00
Jeff McCune
12544569fb Update the module example test manifest
This change provides a clear indication about how relationships
are expected to be managed when the end user consumes the module.
2011-06-16 17:44:34 -07:00
Jeff McCune
e09792cea9 Add Debian based distro support.
This change separates the package resource into an implementation
class following the composite class pattern.

In addition, the _real variables have been removed to prevent
confusion.

The validation functions have been updated to support a more
clear regular expression.

The debian package names are different, so conditional logic
is required to set a debian based distro specific variable
for the Java distribution name.

While the puppet resources work, there is currently an issue
on Lucid where the package REQUIRES interactive installation
to accept the license agreement.  This will need to be fixed
for fully automated deployment on apt based systems.
2011-06-16 17:43:56 -07:00
Jeff McCune
3b00510615 Update CHANGELOG for version 0.1.4 2011-06-02 17:40:29 -07:00
Jeff McCune
07ea32a90c Merge branch 'bug/master/class_ordering'
* bug/master/class_ordering:
  Fix ordering issues with composed classes
2011-06-02 17:39:53 -07:00
Jeff McCune
c503afd73e Fix ordering issues with composed classes
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.
2011-06-02 17:37:19 -07:00
9 changed files with 124 additions and 73 deletions

View File

@@ -1,3 +1,9 @@
2011-06-16 Jeff McCune <jeff@puppetlabs.com> - 0.1.5
* Add Debian based distro (Lucid) support
2011-06-02 Jeff McCune <jeff@puppetlabs.com> - 0.1.4
* Fix class composition ordering problems
2011-05-28 Jeff McCune <jeff@puppetlabs.com> - 0.1.3
* Remove stages

View File

@@ -1,5 +1,5 @@
name 'puppetlabs-java'
version '0.1.3'
version '0.1.5'
source 'git://github.com/puppetlabs/puppetlabs-java'
author 'puppetlabs'
license 'Apache'
@@ -8,4 +8,4 @@ description 'Manage the official Java runtime'
project_page 'https://github.com/puppetlabs/puppetlabs-java'
## 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.
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.
@@ -14,3 +21,13 @@ Please download the installer from:
* [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,26 +16,44 @@ class java(
$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)
validate_re($distribution, '^jdk$|^jre$')
validate_re($version, 'installed|^[._0-9a-zA-Z:-]+$')
$version_real = $version
$distribution_real = $distribution
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: {
$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")
}
case $distribution_real {
jre: {
class { 'java::jre_package':
version => $version_real,
}
}
jdk: {
class { 'java::jdk_package':
version => $version_real,
}
}
}
}

View File

@@ -1,29 +0,0 @@
# Class: java:jdk_package
#
# This class installs the Java JDK package
# produced from ./jdk-6u25-linux-x64-rpm.bin -x
#
# This is the "Official" RPM distributed by Oracle
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class java::jdk_package (
$version
) {
validate_re($version, '^[._0-9a-zA-Z:-]+$')
$version_real = $version
package { 'jdk':
ensure => $version_real,
alias => 'java',
}
}

View File

@@ -1,26 +0,0 @@
# Class: java:jre_package
#
# class description goes here.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class java::jre_package (
$version
) {
validate_re($version, '^[._0-9a-zA-Z:-]+$')
$version_real = $version
package { 'jre':
ensure => $version_real,
alias => 'java',
}
}

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": }
}