Compare commits

...

93 Commits
0.1.3 ... 1.1.1

Author SHA1 Message Date
Morgan Haskel
97333e6473 Prepare a 1.1.1 release. 2014-05-02 13:36:46 -07:00
Ashley Penney
b31311c52f Merge pull request #56 from e1337h4xx/master
Added jessie as a supported realese
2014-04-08 09:04:11 -04:00
31337
f7d1b2df49 Added jessie as a supported realese 2014-04-08 09:41:24 +02:00
Hunter Haugen
5380a9d1b5 Merge pull request #55 from atta/master
add support for ubuntu 14.04 trusty
2014-03-25 10:42:38 -07:00
Ansgar Jazdzewski
6b16325674 add support for ubuntu 14.04 trusty 2014-03-25 16:30:59 +01:00
Ashley Penney
ff014703e3 Merge pull request #51 from apenney/110-release
Prepare a 1.1.0 release.
2014-01-06 10:45:41 -08:00
Ashley Penney
ab5d9d6497 Prepare a 1.1.0 release. 2014-01-06 13:44:20 -05:00
Ashley Penney
6baf0b0fe9 Merge pull request #50 from CpuID/master
plus signs are valid in debian/ubuntu package versions
2014-01-06 10:36:00 -08:00
Nathan Sullivan
2f4232af6b plus signs are valid in debian/ubuntu package versions 2014-01-06 15:29:52 +10:00
Ashley Penney
4eab7dd77f Merge pull request #46 from openstack-hyper-v/master
adding support for ubuntu saucy
2013-11-18 10:52:41 -08:00
Ashley Penney
9cf9bcb9da Merge pull request #47 from liwo/feature/java-home
Add $java_home variable
2013-11-18 10:00:59 -08:00
Lienhart Woitok
dea01a7445 Add $java_home variable
On several places I needed to set the JAVA_HOME environment variable
for some software. To have this controlled in a central place I added
it here.
2013-11-18 11:11:24 +01:00
Peter Pouliot
c2a3171e55 adding support for ubuntu saucy 2013-11-15 01:50:07 -05:00
Brett Porter
6f91a2f8ab Merge pull request #38 from brettporter/scientific
Support Scientific Linux
2013-09-25 21:03:32 -07:00
Ashley Penney
f8c07504bb Merge pull request #44 from jengels/patch-1
Update params.pp
2013-09-24 15:21:04 -07:00
jengels
3dc47805e1 Update params.pp
Added Scientific Linux to list of RedHat operating systems
2013-09-23 11:34:58 +02:00
Brett Porter
304a4343ab Support Scientific Linux
Addresses issue #37
2013-08-05 13:53:58 +10:00
Ashley Penney
f3f521d7bc Merge pull request #36 from apenney/travisrelease
Fix travis script.
2013-08-01 15:28:22 -07:00
Ashley Penney
b877ecc8fe Fix travis script. 2013-08-01 18:27:11 -04:00
Ashley Penney
fe9e12d2b4 Merge pull request #35 from brettporter/v1.0.1
CHANGELOG for 1.0.1
2013-08-01 15:22:53 -07:00
Brett Porter
7df975ad18 CHANGELOG for 1.0.1 2013-08-02 08:08:22 +10:00
Brett Porter
1f071f1b96 Ensure right Puppet version in place for Travis
Keep PUPPET_VERSION for any existing uses, use PUPPET_GEM_VERSION for the
version spec that is supplied via .travis.yml.
2013-08-02 07:38:03 +10:00
Brett Porter
a94f5195e0 Revert "Ensure Travis runs with the right Puppet"
This reverts commit e12dbd2f9a.
2013-08-02 07:31:01 +10:00
Brett Porter
e12dbd2f9a Ensure Travis runs with the right Puppet
NEed to line up the environment variable with the one used in the Gemfile.
2013-08-02 07:20:17 +10:00
Brett Porter
4805628682 Merge pull request #33 from apenney/readme
Tweak the README (to test travis).
2013-08-01 14:08:44 -07:00
Brett Porter
816958fed1 Merge pull request #34 from haus/update_fedora_java
Update fedora java
2013-08-01 14:05:10 -07:00
Matthaus Owens
bf7edcf299 Update java packages for Fedora systems
The java package on Fedora is currently java-1.7.0-openjdk for their basic
java, and java-1.7.0-openjdk-devel for a development set. Fedora 16 had
java-1.6.0-openjdk, but it has been EOL for a long time. This commit updates
the default java for Fedora to the 1.7.0 package.
2013-08-01 12:15:12 -07:00
Matthaus Owens
3556af3a49 Trailing whitespace cleanup. 2013-08-01 12:15:08 -07:00
Ashley Penney
d3398aa52b Tweak the README (to test travis). 2013-07-29 20:19:51 -04:00
Ashley Penney
c0d41b043a Merge pull request #32 from apenney/travis
Add a .travis.yml file.
2013-07-29 17:17:59 -07:00
Ashley Penney
c0e3e81a3f Add a .travis.yml file. 2013-07-29 20:17:03 -04:00
Ashley Penney
0f69865c3d Merge pull request #31 from brettporter/version-1
Update version to 1.0.0
2013-07-29 17:14:57 -07:00
Brett Porter
e7b585b346 Update version to 1.0.0 2013-07-30 10:02:54 +10:00
Brett Porter
45c4d89261 add changelog entry for #30 2013-07-29 12:45:47 +10:00
Brett Porter
454a1c73f7 Merge pull request #30 from wavesoftware/master
Adding support for Oracle Enterprise Linux with spec tests
2013-07-28 19:41:54 -07:00
Krzysztof Suszyński
2d70d838ba Adding support for Oracle Enterprise Linux with spec tests 2013-07-26 14:21:32 +02:00
Krzysztof Suszyński
50a23d1704 Adding support for Oracle Enterprise Linux 2013-07-26 13:53:25 +02:00
Brett Porter
aa89d8b510 Add support for natty
Reimplementation of PR #19 to cleanup superfluous commits, and adjust to new
module structure.
2013-07-13 13:28:33 +10:00
Brett Porter
e73f175f3a Merge branch 'master' of https://github.com/rombert/puppetlabs-java into rombert-master
Conflicts:
	manifests/params.pp
2013-07-13 13:22:44 +10:00
Brett Porter
90485daa12 changelog entry for previous commit 2013-07-13 13:16:18 +10:00
Brett Porter
86024aeef8 Use HTTP for fixture checkout
For testing over conference wifi!
2013-07-13 13:14:50 +10:00
Brett Porter
9188f0e15a Merge pull request #29 from actionjack/master
Added support for Amazon linux
2013-07-12 20:11:22 -07:00
Brett Porter
6f7cdb76b4 Merge branch 'preferences' of https://github.com/mediatemple/puppetlabs-java into mediatemple-preferences
Conflicts:
	CHANGELOG
2013-07-13 13:09:40 +10:00
Sharif Nassar
ad93b44405 Support multiple JVM, and Debian alternatives.
Add ability to customize which JVM is installed on Debian.
Additionally, configure alternatives on Debian.
2013-06-20 16:29:20 -07:00
Martin Jackson
9fcf5d1a23 Added support Amazon Linux using facter >= 1.7.x. Fixes 1. 2013-06-20 11:03:01 +01:00
Martin Jackson
d531f47e8f Added some files for git to ignore. Stop Intellij/RubyMine from polluting source tree. 2013-06-20 10:41:34 +01:00
Brett Porter
8ab5b99a56 add a changelog for recently added changes 2013-06-19 17:49:07 +10:00
Robert Munteanu
3ac6dd5966 Add support for OpenSUSE 2013-06-10 17:44:27 +03:00
Brett Porter
cde7046e99 Merge branch 'fixes_for_centos_versions' of https://github.com/garethr/puppetlabs-java into garethr-fixes_for_centos_versions
Conflicts:
	Modulefile
	README.markdown
	manifests/init.pp
	spec/spec_helper.rb
2013-06-02 21:47:19 -07:00
Brett Porter
44280b3535 Merge pull request #26 from nrvale0/add_quantal
add support for Ubuntu quantal and raring
2013-06-02 20:52:17 -07:00
Nathan R Valentine
f85cbd5381 add support for Ubuntu quantal and raring 2013-05-31 19:38:12 -07:00
Matthaus Owens
bd50a396ef Merge pull request #25 from reidmv/reduce_complexity
Reduce complexity
2013-04-06 23:00:17 -07:00
Reid Vandewiele
b46f256b11 Remove cruft and bumb version number 2013-04-04 20:19:37 -07:00
Reid Vandewiele
5091d7fd6a Add package as class parameter
In case the defaults aren't good enough
2013-04-04 20:19:37 -07:00
Reid Vandewiele
f7a95a1e0e Refactor and reduce
The module in its previous incarnation was unnecessarily hard to read
and use. This commit applies the "params" pattern in order to more
clearly deliniate between logical variable selection and actual
declarative configuration.
2013-04-04 20:19:36 -07:00
Gareth Rushgrove
f5ee99f297 update list of tested repositories in readme 2013-04-02 16:15:57 +01:00
Gareth Rushgrove
b637c2e7e7 format modulefile 2013-04-02 16:08:37 +01:00
Gareth Rushgrove
5007be2226 get correct jdk version for centos 5.8 and 6.3 2013-04-02 16:08:14 +01:00
Gareth Rushgrove
4b54bab0cb add tests for the current an expected centos behaviour 2013-04-02 16:07:20 +01:00
Gareth Rushgrove
1d5c5992ab ignore fixtures downloaded by test runner 2013-04-02 16:06:16 +01:00
Gareth Rushgrove
6a4ca4f7c7 add rake file to run tests and build module 2013-04-02 16:05:40 +01:00
Gareth Rushgrove
d15243493b add puppet module dependencies for testing 2013-04-02 16:04:57 +01:00
Gareth Rushgrove
1f7545b213 add testing dependencies 2013-04-02 16:04:31 +01:00
Scott Schneider
ff80bc7f79 Merge pull request #23 from haus/fix_fedora
Add special case for fedora operating systems, where java is installable...
2013-02-19 15:59:08 -08:00
Matthaus Owens
995b985d37 Add special case for fedora operating systems, where java is installable, but jdk is not. 2013-02-19 15:37:30 -08:00
Matthaus Owens
234fd7b650 Merge pull request #22 from puppetlabs/suse_support
Adding java::package_suse class
2013-01-08 15:38:35 -08:00
Scott Schneider
7264c4022e Adding java::package_suse class 2012-12-27 10:59:12 -08:00
Adrien Thebo
017a749d13 Merge pull request #18 from sschneid/master
Add Solaris support
2012-11-15 11:58:49 -08:00
Scott Schneider
e37f6d5af6 Bumping version to 0.2.0 2012-11-15 11:55:53 -08:00
Scott Schneider
c797e52851 Add Solaris support 2012-11-15 11:23:08 -08:00
Chris Price
4ab58a2f88 Merge pull request #14 from eshamow/use_osfamily_instead_of_operatingsystem
Use osfamily instead of operatingsystem to determine package
2012-10-18 19:10:37 -07:00
Eric Shamow
3afa0813ea Use osfamily instead of operatingsystem to determine package
osfamily is slightly more forgiving, especially for RHEL-based
distributions.
2012-07-10 15:50:27 -06:00
Ben Hughes
4d7154516d Merge pull request #13 from ody/move_to_openjdk
Moves debain packages to openjdk.
2012-05-30 16:18:06 -07:00
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
Cody Herriges
30b07259a2 Moves debain packages to openjdk.
Change sun-java6-* packages to their openjdk equivalents and add conditional
  based on lsb codename to determine which version to install.
2012-05-09 15:43:19 -07:00
Gary Larizza
6365fcd9f2 Merge pull request #11 from ccaum/master
Allow distributions starting with string `java`

Reviewed-by: Gary Larizza <gary@puppetlabs.com>
2011-09-13 19:28:29 -07:00
Carl Caum
a671ad7cc4 Allow distributions starting with java
Some java distributions can start with java, such as java-sun or java-1.6.0-openjdk.  We should allow these to be specified
2011-09-13 19:55:24 +00:00
Ken Barber
0e4dc2dd81 Merge pull request #10 from kbarber/issues/master/9_empty-metadata
9 - remove empty metadata.json from repo to avoid errors when using from
2011-06-25 11:25:33 -07:00
Ken Barber
4c1161891b 9 - remove empty metadata.json from repo to avoid errors when using from github. 2011-06-25 19:23:45 +01:00
Ken Barber
98e1d30235 Merge pull request #7 from kbarber/issue/master/5_preseed_for_license
5 - Provide a preseed file that preseeds license signing for java package
2011-06-25 11:17:26 -07:00
Ken Barber
b5854b3ef3 Merge pull request #8 from kbarber/issues/master/4_license-file
4 - Add license file.
2011-06-25 10:57:01 -07:00
Ken Barber
e6be2ed785 4 - Add license file. 2011-06-24 23:16:12 +02:00
Ken Barber
b547e53a8b 5 - Provide a preseed file that preseeds license signing for java packages. 2011-06-24 22:52:58 +02:00
Jeff McCune
3b674ac225 Whitespace only change to README 2011-06-16 19:02:34 -07:00
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
20 changed files with 556 additions and 134 deletions

5
.fixtures.yml Normal file
View File

@@ -0,0 +1,5 @@
fixtures:
repositories:
stdlib: http://github.com/puppetlabs/puppetlabs-stdlib.git
symlinks:
java: "#{source_dir}"

5
.gitignore vendored
View File

@@ -1,2 +1,7 @@
pkg/ pkg/
.DS_Store .DS_Store
metadata.json
spec/fixtures
*.idea
*.swp
*.tmp

40
.travis.yml Normal file
View File

@@ -0,0 +1,40 @@
---
branches:
only:
- master
language: ruby
bundler_args: --without development
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
after_success:
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng
- .forge-release/publish
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
env:
matrix:
- PUPPET_GEM_VERSION="~> 2.7.0"
- PUPPET_GEM_VERSION="~> 3.0.0"
- PUPPET_GEM_VERSION="~> 3.1.0"
- PUPPET_GEM_VERSION="~> 3.2.0"
global:
- PUBLISHER_LOGIN=puppetlabs
- secure: |-
InMPZJVSGFC/AfcTbM6eKpYjPU3L1m1/P8BiXwcwreeyz0elsX2qmXk80A1h
\nakUY6VxLtzcFGBHV1V8NvpRHovUBSzRGuhSFUm72XL62OB6TMl+Wg30coJ
/N\nXjEfy7N5TQ3ThTKf1gfph0x/3iJBPgqIuIIELJCQJusTRDPKWYQ=
matrix:
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.2.0"
notifications:
email: false

View File

@@ -1,3 +1,75 @@
2014-05-02 - Version 1.1.1
Summary:
Add support for new versions of Debian and Ubuntu!
Features:
- Add support for Ubuntu Trusty (14.04)
- Add support for Debian Jessie (8.x)
2014-01-06 - Version 1.1.0
Summary:
Primarily a release for Ubuntu users!
Features:
- Add support for Ubuntu Saucy (13.10)
- Add `java_home` parameter for centralized setting of JAVA_HOME.
Bugfixes:
- Plus signs are valid in debian/ubuntu package names.
1.0.2 ()
Brett Porter <brett@apache.org>
* Support Scientific Linux
1.0.1 (2013-08-01)
Matthaus Owens <matthaus@puppetlabs.com>
* Update java packages for Fedora systems
1.0.0 (2013-07-29)
Krzysztof Suszyński <krzysztof.suszynski@coi.gov.pl>
* Adding support for Oracle Enterprise Linux
Peter Drake <pdrake@allplayers.com>
* Add support for natty
Robert Munteanu <rmuntean@adobe.com>
* Add support for OpenSUSE
Martin Jackson <martin@uncommonsense-uk.com>
* Added support Amazon Linux using facter >= 1.7.x
Gareth Rushgrove <gareth@morethanseven.net>
Brett Porter <brett@apache.org>
* Fixes for older versions of CentOS
* Improvements to module build and tests
Nathan R Valentine <nrvale0@gmail.com>
* Add support for Ubuntu quantal and raring
Sharif Nassar <sharif@mediatemple.net>
* Add support for Debian alternatives, and more than one JDK/JRE per platform.
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

15
Gemfile Normal file
View File

@@ -0,0 +1,15 @@
source "http://rubygems.org"
if ENV.key?('PUPPET_VERSION')
puppetversion = "= #{ENV['PUPPET_VERSION']}"
elsif ENV.key?('PUPPET_GEM_VERSION')
puppetversion = ENV['PUPPET_GEM_VERSION']
else
puppetversion = ['~> 2.7']
end
gem "rake"
gem "puppet", puppetversion
gem "puppet-lint"
gem "rspec-puppet"
gem "puppetlabs_spec_helper"

43
Gemfile.lock Normal file
View File

@@ -0,0 +1,43 @@
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.2.2)
facter (1.7.2)
hiera (1.2.1)
json_pure
json_pure (1.8.0)
metaclass (0.0.1)
mocha (0.13.3)
metaclass (~> 0.0.1)
puppet (3.2.3)
facter (~> 1.6)
hiera (~> 1.0)
rgen (~> 0.6.5)
puppet-lint (0.3.2)
puppetlabs_spec_helper (0.4.1)
mocha (>= 0.10.5)
rake
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
rake (10.0.4)
rgen (0.6.5)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
rspec-puppet (0.1.6)
rspec
PLATFORMS
ruby
DEPENDENCIES
puppet (~> 3.2.0)
puppet-lint
puppetlabs_spec_helper
rake
rspec-puppet

17
LICENSE Normal file
View 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.

View File

@@ -1,5 +1,5 @@
name 'puppetlabs-java' name 'puppetlabs-java'
version '0.1.3' version '1.1.1'
source 'git://github.com/puppetlabs/puppetlabs-java' source 'git://github.com/puppetlabs/puppetlabs-java'
author 'puppetlabs' author 'puppetlabs'
license 'Apache' license 'Apache'
@@ -7,5 +7,4 @@ summary 'Manage the official Java runtime'
description 'Manage the official Java runtime' 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: dependency 'puppetlabs/stdlib', '>= 0.1.6'
dependency 'puppetlabs/stdlib', '>= 0.1.3'

View File

@@ -1,16 +1,5 @@
# Java # #Java
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)

5
Rakefile Normal file
View File

@@ -0,0 +1,5 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"

17
manifests/config.pp Normal file
View File

@@ -0,0 +1,17 @@
# On Debian systems, if alternatives are set, manually assign them.
class java::config ( ) {
case $::osfamily {
Debian: {
if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef {
exec { 'update-java-alternatives':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => "update-java-alternatives --set ${java::use_java_alternative} --jre",
unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'",
}
}
}
default: {
# Do nothing.
}
}
}

View File

@@ -4,38 +4,92 @@
# #
# Parameters: # Parameters:
# #
# [*distribution*]
# The java distribution to install. Can be one of "jdk" or "jre",
# or other platform-specific options where there are multiple
# implementations available (eg: OpenJDK vs Oracle JDK).
#
#
# [*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.
#
# [*java_alternative*]
# The name of the java alternative to use on Debian systems.
# "update-java-alternatives -l" will show which choices are available.
# If you specify a particular package, you will almost always also
# want to specify which java_alternative to choose. If you set
# this, you also need to set the path below.
#
# [*java_alternative_path*]
# The path to the "java" command on Debian systems. Since the
# alternatives system makes it difficult to verify which
# alternative is actually enabled, this is required to ensure the
# correct JVM is enabled.
#
# 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,
$java_alternative = undef,
$java_alternative_path = 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 if has_key($java::params::java, $distribution) {
$distribution_real = $distribution $default_package_name = $java::params::java[$distribution]['package']
$default_alternative = $java::params::java[$distribution]['alternative']
$default_alternative_path = $java::params::java[$distribution]['alternative_path']
$java_home = $java::params::java[$distribution]['java_home']
} else {
fail("Java distribution ${distribution} is not supported.")
}
case $distribution_real { $use_java_package_name = $package ? {
jre: { default => $package,
class { 'java::jre_package': undef => $default_package_name,
version => $version_real, }
## If $java_alternative is set, use that.
## Elsif the DEFAULT package is being used, then use $default_alternative.
## Else undef
$use_java_alternative = $java_alternative ? {
default => $java_alternative,
undef => $use_java_package_name ? {
$default_package_name => $default_alternative,
default => undef,
} }
} }
jdk: {
class { 'java::jdk_package': ## Same logic as $java_alternative above.
version => $version_real, $use_java_alternative_path = $java_alternative_path ? {
default => $java_alternative_path,
undef => $use_java_package_name ? {
$default_package_name => $default_alternative_path,
default => undef,
} }
} }
anchor { 'java::begin:': }
->
package { 'java':
ensure => $version,
name => $use_java_package_name,
} }
->
class { 'java::config': }
-> anchor { 'java::end': }
} }

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',
}
}

133
manifests/params.pp Normal file
View File

@@ -0,0 +1,133 @@
# Class: java::params
#
# This class builds a hash of JDK/JRE packages and (for Debian)
# alternatives. For wheezy/precise, we provide Oracle JDK/JRE
# options, even though those are not in the package repositories.
#
# For more info on how to package Oracle JDK/JRE, see the Debian wiki:
# http://wiki.debian.org/JavaPackage
#
# Because the alternatives system makes it very difficult to tell
# which Java alternative is enabled, we hard code the path to bin/java
# for the config class to test if it is enabled.
class java::params {
case $::osfamily {
default: { fail("unsupported platform ${::osfamily}") }
'RedHat': {
case $::operatingsystem {
default: { fail("unsupported os ${::operatingsystem}") }
'RedHat', 'CentOS', 'OracleLinux', 'Scientific': {
if (versioncmp($::operatingsystemrelease, '5.0') < 0) {
$jdk_package = 'java-1.6.0-sun-devel'
$jre_package = 'java-1.6.0-sun'
}
elsif (versioncmp($::operatingsystemrelease, '6.3') < 0) {
$jdk_package = 'java-1.6.0-openjdk-devel'
$jre_package = 'java-1.6.0-openjdk'
}
else {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
}
'Fedora': {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
'Amazon': {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
}
$java = {
'jdk' => { 'package' => $jdk_package, },
'jre' => { 'package' => $jre_package, },
}
}
'Debian': {
case $::lsbdistcodename {
default: { fail("unsupported release ${::lsbdistcodename}") }
'lenny', 'squeeze', 'lucid', 'natty': {
$java = {
'jdk' => {
'package' => 'openjdk-6-jdk',
'alternative' => 'java-6-openjdk',
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
},
'jre' => {
'package' => 'openjdk-6-jre-headless',
'alternative' => 'java-6-openjdk',
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
},
'sun-jre' => {
'package' => 'sun-java6-jre',
'alternative' => 'java-6-sun',
'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-sun/jre/',
},
'sun-jdk' => {
'package' => 'sun-java6-jdk',
'alternative' => 'java-6-sun',
'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-sun/jre/',
},
}
}
'wheezy', 'jessie', 'precise','quantal','raring','saucy', 'trusty': {
$java = {
'jdk' => {
'package' => 'openjdk-7-jdk',
'alternative' => "java-1.7.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/",
},
'jre' => {
'package' => 'openjdk-7-jre-headless',
'alternative' => "java-1.7.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/",
},
'oracle-jre' => {
'package' => 'oracle-j2re1.7',
'alternative' => 'j2re1.7-oracle',
'alternative_path' => '/usr/lib/jvm/j2re1.7-oracle/bin/java',
'java_home' => '/usr/lib/jvm/j2re1.7-oracle/',
},
'oracle-jdk' => {
'package' => 'oracle-j2sdk1.7',
'alternative' => 'j2sdk1.7-oracle',
'alternative_path' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/bin/java',
'java_home' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/',
},
}
}
}
}
'Solaris': {
$java = {
'jdk' => { 'package' => 'developer/java/jdk-7', },
'jre' => { 'package' => 'runtime/java/jre-7', },
}
}
'Suse': {
case $::operatingsystem {
default: {
$jdk_package = 'java-1_6_0-ibm-devel'
$jre_package = 'java-1_6_0-ibm'
}
'OpenSuSE': {
$jdk_package = 'java-1_7_0-openjdk-devel'
$jre_package = 'java-1_7_0-openjdk'
}
}
$java = {
'jdk' => { 'package' => $jdk_package, },
'jre' => { 'package' => $jre_package, },
}
}
}
}

View File

@@ -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. |
| |
+-----------------------------------------------------------------------+
*/
{}

115
spec/classes/java_spec.rb Normal file
View File

@@ -0,0 +1,115 @@
require 'spec_helper'
describe 'java', :type => :class do
context 'select openjdk for Centos 5.8' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.8'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
context 'select openjdk for Centos 6.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.3'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
end
context 'select openjdk for Centos 6.2' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.2'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
context 'select openjdk for Fedora' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Fedora'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
end
context 'select passed value for Fedora' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Fedora'} }
let(:params) { { 'distribution' => 'jre' } }
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
end
context 'select passed value for Centos 5.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
let(:params) { { 'package' => 'jdk' } }
it { should contain_package('java').with_name('jdk') }
it { should_not contain_exec('update-java-alternatives') }
end
context 'select default for Centos 5.3' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
it { should_not contain_exec('update-java-alternatives') }
end
context 'select default for Debian Wheezy' do
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', :architecture => 'amd64',} }
it { should contain_package('java').with_name('openjdk-7-jdk') }
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-1.7.0-openjdk-amd64 --jre') }
end
context 'select Oracle JRE for Debian Wheezy' do
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', } }
let(:params) { { 'distribution' => 'oracle-jre' } }
it { should contain_package('java').with_name('oracle-j2re1.7') }
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set j2re1.7-oracle --jre') }
end
context 'select default for Debian Squeeze' do
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5'} }
it { should contain_package('java').with_name('openjdk-6-jdk') }
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-openjdk --jre') }
end
context 'select Oracle JRE for Debian Squeeze' do
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5'} }
let(:params) { { 'distribution' => 'sun-jre', } }
it { should contain_package('java').with_name('sun-java6-jre') }
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-sun --jre') }
end
context 'select random alternative for Debian Wheezy' do
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1'} }
let(:params) { { 'java_alternative' => 'bananafish' } }
it { should contain_package('java').with_name('openjdk-7-jdk') }
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set bananafish --jre') }
end
context 'select openjdk for Amazon Linux' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Amazon', :operatingsystemrelease => '3.4.43-43.43.amzn1.x86_64'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
end
context 'select passed value for Amazon Linux' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Amazon', :operatingsystemrelease => '5.3.4.43-43.43.amzn1.x86_64'} }
let(:params) { { 'distribution' => 'jre' } }
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
end
context 'select openjdk for Oracle Linux' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.4'} }
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
end
context 'select openjdk for Oracle Linux 6.2' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.2'} }
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
end
context 'select passed value for Oracle Linux' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.3'} }
let(:params) { { 'distribution' => 'jre' } }
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
end
context 'select passed value for Scientific Linux' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Scientific', :operatingsystemrelease => '6.4'} }
let(:params) { { 'distribution' => 'jre' } }
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
end
context 'select default for OpenSUSE 12.3' do
let(:facts) { {:osfamily => 'Suse', :operatingsystem => 'OpenSUSE', :operatingsystemrelease => '12.3'}}
it { should contain_package('java').with_name('java-1_7_0-openjdk-devel')}
end
end

View File

@@ -1,6 +0,0 @@
--format
s
--colour
--loadby
mtime
--backtrace

View File

@@ -1,18 +1 @@
require 'pathname' require 'puppetlabs_spec_helper/module_spec_helper'
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

View File

@@ -1 +1,4 @@
include java class { 'java':
distribution => 'jdk',
version => 'latest',
}