Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd50a396ef | ||
|
|
b46f256b11 | ||
|
|
5091d7fd6a | ||
|
|
f7a95a1e0e | ||
|
|
ff80bc7f79 | ||
|
|
995b985d37 | ||
|
|
234fd7b650 | ||
|
|
7264c4022e | ||
|
|
017a749d13 | ||
|
|
e37f6d5af6 | ||
|
|
c797e52851 | ||
|
|
4ab58a2f88 | ||
|
|
3afa0813ea | ||
|
|
4d7154516d | ||
|
|
d027d35e2d | ||
|
|
30b07259a2 | ||
|
|
6365fcd9f2 | ||
|
|
a671ad7cc4 | ||
|
|
0e4dc2dd81 | ||
|
|
4c1161891b | ||
|
|
98e1d30235 | ||
|
|
b5854b3ef3 | ||
|
|
e6be2ed785 | ||
|
|
b547e53a8b | ||
|
|
3b674ac225 | ||
|
|
8a7c2fce30 | ||
|
|
babdde5f02 | ||
|
|
0b541605e1 | ||
|
|
8aa2053c9d | ||
|
|
12544569fb | ||
|
|
e09792cea9 | ||
|
|
3b00510615 | ||
|
|
07ea32a90c | ||
|
|
c503afd73e |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
pkg/
|
pkg/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
metadata.json
|
||||||
|
|||||||
12
CHANGELOG
12
CHANGELOG
@@ -1,3 +1,15 @@
|
|||||||
|
2013-04-04 Reid Vandewiele <reid@puppetlabs.com> - 0.3.0
|
||||||
|
* Refactor, introduce params pattern
|
||||||
|
|
||||||
|
2012-11-15 Scott Schneider <sschneider@puppetlabs.com> - 0.2.0
|
||||||
|
* Add Solaris support
|
||||||
|
|
||||||
|
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
|
2011-05-28 Jeff McCune <jeff@puppetlabs.com> - 0.1.3
|
||||||
* Remove stages
|
* Remove stages
|
||||||
|
|
||||||
|
|||||||
17
LICENSE
Normal file
17
LICENSE
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
Puppet Java Module - Puppet module for managing Java
|
||||||
|
|
||||||
|
Copyright (C) 2011 Puppet Labs Inc
|
||||||
|
|
||||||
|
Puppet Labs can be contacted at: info@puppetlabs.com
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name 'puppetlabs-java'
|
name 'puppetlabs-java'
|
||||||
version '0.1.3'
|
version '0.3.0'
|
||||||
source 'git://github.com/puppetlabs/puppetlabs-java'
|
source 'git://github.com/puppetlabs/puppetlabs-java'
|
||||||
author 'puppetlabs'
|
author 'puppetlabs'
|
||||||
license 'Apache'
|
license 'Apache'
|
||||||
@@ -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'
|
||||||
|
|||||||
@@ -2,15 +2,4 @@
|
|||||||
|
|
||||||
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 deploys the correct Java package on a variety of platforms.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
./jdk-6u25-linux-x64-rpm.bin -x
|
|
||||||
|
|
||||||
Please download the installer from:
|
|
||||||
|
|
||||||
* [Java Downloads](http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html)
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,38 +4,50 @@
|
|||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
#
|
#
|
||||||
|
# [*distribution*]
|
||||||
|
# The java distribution to install. Can be one of "jdk" or "jre".
|
||||||
|
#
|
||||||
|
# [*version*]
|
||||||
|
# The version of java to install. By default, this module simply ensures
|
||||||
|
# that java is present, and does not require a specific version.
|
||||||
|
#
|
||||||
|
# [*package*]
|
||||||
|
# The name of the java package. This is configurable in case a non-standard
|
||||||
|
# java package is desired.
|
||||||
|
#
|
||||||
# Actions:
|
# Actions:
|
||||||
#
|
#
|
||||||
# Requires:
|
# Requires:
|
||||||
#
|
#
|
||||||
# Sample Usage:
|
# Sample Usage:
|
||||||
#
|
#
|
||||||
# [Remember: No empty lines between comments and class definition]
|
|
||||||
class java(
|
class java(
|
||||||
$distribution = 'jdk',
|
$distribution = 'jdk',
|
||||||
$version = 'installed'
|
$version = 'present',
|
||||||
|
$package = undef,
|
||||||
) {
|
) {
|
||||||
|
include java::params
|
||||||
|
|
||||||
# Cannot pass anonymous arrays to functions in 2.6.8
|
validate_re($version, 'present|installed|latest|^[._0-9a-zA-Z:-]+$')
|
||||||
$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
|
case $distribution {
|
||||||
$distribution_real = $distribution
|
default: { fail('distribution must be one of jdk, jre') }
|
||||||
|
'jdk': {
|
||||||
case $distribution_real {
|
$default_package_name = $java::params::jdk_package
|
||||||
jre: {
|
|
||||||
class { 'java::jre_package':
|
|
||||||
version => $version_real,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
jdk: {
|
'jre': {
|
||||||
class { 'java::jdk_package':
|
$default_package_name = $java::params::jre_package
|
||||||
version => $version_real,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$use_java_package_name = $package ? {
|
||||||
|
default => $package,
|
||||||
|
undef => $default_package_name,
|
||||||
|
}
|
||||||
|
|
||||||
|
package { 'java':
|
||||||
|
ensure => $version,
|
||||||
|
name => $use_java_package_name,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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',
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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',
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
46
manifests/params.pp
Normal file
46
manifests/params.pp
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Class: java::params
|
||||||
|
#
|
||||||
|
# This class sets the value of two variables, jdk_package and jre_package,
|
||||||
|
# appropriate for the client system in question.
|
||||||
|
#
|
||||||
|
class java::params {
|
||||||
|
|
||||||
|
case $::osfamily {
|
||||||
|
default: { fail("unsupported platform ${::osfamily}") }
|
||||||
|
'RedHat': {
|
||||||
|
case $::operatingsystem {
|
||||||
|
default: { fail("unsupported os ${::operatingsystem}") }
|
||||||
|
'RedHat', 'CentOS': {
|
||||||
|
$jdk_package = 'java-1.7.0-openjdk-devel'
|
||||||
|
$jre_package = 'java-1.7.0-openjdk'
|
||||||
|
}
|
||||||
|
'Fedora': {
|
||||||
|
$jdk_package = 'java'
|
||||||
|
$jre_package = 'java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'Debian': {
|
||||||
|
case $::lsbdistcodename {
|
||||||
|
default: { fail("unsupported release ${::lsbdistcodename}") }
|
||||||
|
'squeeze', 'lucid': {
|
||||||
|
$jdk_package = 'openjdk-6-jdk'
|
||||||
|
$jre_package = 'openjdk-6-jre-headless'
|
||||||
|
}
|
||||||
|
'wheezy', 'precise': {
|
||||||
|
$jdk_package = 'openjdk-7-jdk'
|
||||||
|
$jre_package = 'openjdk-7-jre-headless'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'Solaris': {
|
||||||
|
$jdk_package = 'developer/java/jdk-7'
|
||||||
|
$jre_package = 'runtime/java/jre-7'
|
||||||
|
}
|
||||||
|
'Suse': {
|
||||||
|
$jdk_package = 'java-1_6_0-ibm-devel'
|
||||||
|
$jre_package = 'java-1_6_0-ibm'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
/*
|
|
||||||
+-----------------------------------------------------------------------+
|
|
||||||
| |
|
|
||||||
| ==> DO NOT EDIT THIS FILE! <== |
|
|
||||||
| |
|
|
||||||
| You should edit the `Modulefile` and run `puppet-module build` |
|
|
||||||
| to generate the `metadata.json` file for your releases. |
|
|
||||||
| |
|
|
||||||
+-----------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
{}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
--format
|
|
||||||
s
|
|
||||||
--colour
|
|
||||||
--loadby
|
|
||||||
mtime
|
|
||||||
--backtrace
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
require 'pathname'
|
|
||||||
dir = Pathname.new(__FILE__).parent
|
|
||||||
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')
|
|
||||||
|
|
||||||
require 'mocha'
|
|
||||||
require 'puppet'
|
|
||||||
gem 'rspec', '=1.2.9'
|
|
||||||
require 'spec/autorun'
|
|
||||||
|
|
||||||
Spec::Runner.configure do |config|
|
|
||||||
config.mock_with :mocha
|
|
||||||
end
|
|
||||||
|
|
||||||
# We need this because the RAL uses 'should' as a method. This
|
|
||||||
# allows us the same behaviour but with a different method name.
|
|
||||||
class Object
|
|
||||||
alias :must :should
|
|
||||||
end
|
|
||||||
@@ -1 +1,4 @@
|
|||||||
include java
|
class { 'java':
|
||||||
|
distribution => 'jdk',
|
||||||
|
version => 'latest',
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user