Compare commits

..

105 Commits
0.3.0 ... 1.2.0

Author SHA1 Message Date
Morgan Haskel
92bd03eec3 Merge pull request #85 from cyberious/1.2.x
Remove misleading changelog, no readme changes done
2014-11-06 16:58:19 -08:00
Travis Fields
3e989f3c04 Update readme to reflect the SLES 12 addition, also fix whitespace in front of 'version 2014-11-06 16:34:02 -08:00
Morgan Haskel
c790b0b955 Merge pull request #84 from cyberious/Release1.2.0
Prepare 1.2.0 release
2014-11-06 13:15:17 -08:00
Travis Fields
50ca60cbee Prep for 1.2.0 supported release 2014-11-06 11:08:48 -08:00
Morgan Haskel
830bb07990 Merge pull request #82 from cyberious/TestcaseFixes
Fixed issue with installing stdlib on certain platforms due to ssl issues
2014-11-05 16:53:04 -08:00
Travis Fields
abad30de06 Update defaults for SLES
Fixed test issues with solaris-11 and added support for sles-12
2014-11-05 16:04:52 -08:00
Morgan Haskel
7224baa72d Merge pull request #64 from kian/master
place default case last in selectors
2014-10-29 18:48:16 -04:00
Hunter Haugen
3c41c8ae8b Merge pull request #77 from PierreR/patch-2
Fix syntax
2014-09-29 09:28:17 -07:00
Hunter Haugen
5f60d5e2c0 Merge pull request #79 from cyberious/master
Remove puppet_module_install in favor of copy_module_to
2014-09-10 12:09:28 -07:00
Travis Fields
d1d1ec2327 Remove puppet_module_install in favor of copy_module_to 2014-09-10 11:30:52 -07:00
VaishaliSaxena
bb34cb71cd Merge pull request #78 from hunner/remove_oel_5
OEL 5 is trying to use up2date which doesn't work
2014-09-02 12:57:22 -07:00
Hunter Haugen
e849b5029c OEL 5 is trying to use up2date which doesn't work 2014-09-02 12:56:21 -07:00
Pi3r
5ad98b17be Fix syntax 2014-09-01 14:39:24 +02:00
Hunter Haugen
db0f428a66 Merge pull request #75 from hunner/fix_spec
Ah hah, got it
2014-08-28 18:34:22 -07:00
Hunter Haugen
fb38145cd4 Ah hah, got it 2014-08-28 18:33:56 -07:00
Hunter Haugen
92d53c084e Merge pull request #74 from hunner/spec_filter
Maybe spec filters work like this
2014-08-28 18:21:41 -07:00
Hunter Haugen
4cf0088f91 Maybe spec filters work like this 2014-08-28 18:21:09 -07:00
Hunter Haugen
3648bd8b70 Merge pull request #73 from hunner/spec_typo
Spec typo
2014-08-28 17:53:30 -07:00
Hunter Haugen
30a5311d73 Spec typo 2014-08-28 17:53:11 -07:00
Hunter Haugen
c781b2fa63 Merge pull request #72 from hunner/fix_comma
Misplaced comma
2014-08-28 17:04:58 -07:00
Hunter Haugen
9823d8eefd Misplaced comma 2014-08-28 17:04:44 -07:00
VaishaliSaxena
353e5ee694 Merge pull request #71 from hunner/rm_meta
Remove sci 7 from metadata
2014-08-28 16:50:08 -07:00
Hunter Haugen
6556d18c86 Remove sci 7 from metadata 2014-08-28 16:48:03 -07:00
VaishaliSaxena
eae176c5b0 Merge pull request #70 from hunner/update_tests
Remove Sci 7 from readme and update oracle linux tests for ubuntu
2014-08-28 16:41:24 -07:00
Hunter Haugen
096196bd89 Remove Sci 7 from readme and update oracle linux tests for ubuntu 2014-08-28 16:38:23 -07:00
Ashley Penney
a231ce8891 Merge pull request #69 from mhaskel/spec_updates
Update spec_helper for consistency
2014-08-28 17:39:44 -04:00
Morgan Haskel
f519b26dbc Update spec_helper for consistency 2014-08-28 17:35:30 -04:00
Ashley Penney
cdc30ce467 Merge pull request #68 from hunner/release_1.1.2
Release 1.1.2
2014-08-25 15:38:28 -04:00
Hunter Haugen
d0a7a72631 Release 1.1.2 2014-08-25 12:32:20 -07:00
Morgan Haskel
4bcc4e732a Merge pull request #67 from hunner/make_deb_work
Make deb work
2014-08-22 17:56:44 -04:00
Hunter Haugen
e4628a345c Debian should fail with incorrect java_alternative 2014-08-22 14:42:15 -07:00
Morgan Haskel
67486853f2 Merge pull request #66 from hunner/make_sol_work
Add more tests and make solaris pass
2014-08-22 16:36:37 -04:00
Hunter Haugen
f09c5e9a17 Add more tests and make solaris pass 2014-08-22 13:27:11 -07:00
Morgan Haskel
ee402d8057 Merge pull request #65 from hunner/add_metadata
Add metadata.json and remove Modulefile
2014-08-22 13:04:51 -04:00
Hunter Haugen
f99141b895 Add metadata.json and remove Modulefile 2014-08-22 10:04:11 -07:00
Kian Mohageri
a04e88d658 place default case last in selectors
According to the selector documentation (https://docs.puppetlabs.com/puppet/latest/reference/lang_conditional.html#selectors), the default case should be last:

"Cases are compared in the order that they are written in the manifest; thus, the default case (if any) must be at the end of the list."

This is fixed in 3.7+ but would be nice to fix in this module for people using < 3.7

See also https://tickets.puppetlabs.com/browse/PUP-2642
2014-08-21 17:51:34 -07:00
Hunter Haugen
ce08df1647 Merge pull request #62 from jbondpdx/java-readme
Java readme
2014-08-15 10:30:22 -07:00
jbondpdx
46e6feee7c Docs: edits to java module readme 2014-08-14 17:35:01 -07:00
jbondpdx
7e8d9587a9 Docs: new readme for java module 2014-08-14 15:41:23 -07:00
Hunter Haugen
8d1b89b43d Merge pull request #60 from puppetlabs/empty_package
Remove empty package test and validation
2014-08-13 13:12:29 -07:00
Hunter Haugen
dcdc96187d Remove empty package test and validation
an empty variable is apparently the same thing as undef, which causes
the packages to be selected as usual.
2014-08-13 13:11:28 -07:00
Hunter Haugen
230ab22adf Merge pull request #59 from puppetlabs/more_tests
Add some validation and more tests
2014-08-13 12:30:19 -07:00
Hunter Haugen
5683eaf74e Add some validation and more tests 2014-08-13 12:17:41 -07:00
Hunter Haugen
66245138f4 Merge pull request #58 from puppetlabs/add_tests
Add acceptance tests
2014-08-13 10:13:29 -07:00
Hunter Haugen
502c94b8ed Add acceptance tests
This includes tests for installing openjdk jdk & jre on most PE
supported platforms.
2014-08-12 09:10:59 -07:00
Ashley Penney
a089f326ca Merge pull request #57 from mhaskel/111-release
Prepare a 1.1.1 release.
2014-05-02 16:39:03 -04:00
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
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
41 changed files with 1284 additions and 75 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,3 +1,6 @@
pkg/
.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,29 +0,0 @@
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
* Remove stages
2011-05-26 Jeff McCune <jeff@puppetlabs.com> - 0.1.2
* Changes JRE/JDK selection class parameter to $distribution
2011-05-25 Jeff McCune <jeff@puppetlabs.com> - 0.1.1
* Re-did versioning to follow semantic versioning
2011-05-25 Jeff McCune <jeff@puppetlabs.com> - 1.0.1
* Add validation of class parameters
2011-05-24 Jeff McCune <jeff@puppetlabs.com> - 1.0.0
* Default to JDK version 6u25
2011-05-24 Jeff McCune <jeff@puppetlabs.com> - 0.0.1
* Initial release

116
CHANGELOG.md Normal file
View File

@@ -0,0 +1,116 @@
##2014-11-11 - Supported Version 1.2.0
###Summary:
This release adds SLES 12 support and is tested for Future Parser Support
####Bugfixes:
- Several readme updates
- Testcase flexability increased
####Features:
- Add SLES 12 support
- Future Parser tested
- Validated against PE 3.7
##2014-08-25 - Supported Version 1.1.2
###Summary:
This release begins the support coverage of the puppetlabs-java module.
###Bugfixes:
- Update java alternative values from deprecated names
- Readme updated
- Testing updated
##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.
- Add Scientific Linux
###Bugfixes:
- Plus signs are valid in debian/ubuntu package names.
##2013-08-01 - Version 1.0.1
Matthaus Owens <matthaus@puppetlabs.com>
* Update java packages for Fedora systems
##2013-07-29 - Version 1.0.0
####Detailed Changes
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 - Version 0.3.0
Reid Vandewiele <reid@puppetlabs.com> -
* Refactor, introduce params pattern
##2012-11-15 - Version 0.2.0
Scott Schneider <sschneider@puppetlabs.com>
* Add Solaris support
##2011-06-16 - Version 0.1.5
Jeff McCune <jeff@puppetlabs.com>
* Add Debian based distro (Lucid) support
##2011-06-02 - Version 0.1.4
Jeff McCune <jeff@puppetlabs.com>
* Fix class composition ordering problems
##2011-05-28 - Version 0.1.3
Jeff McCune <jeff@puppetlabs.com>
* Remove stages
##2011-05-26 - Version 0.1.2
Jeff McCune <jeff@puppetlabs.com>
* Changes JRE/JDK selection class parameter to $distribution
##2011-05-25 - Version 0.1.1
Jeff McCune <jeff@puppetlabs.com>
* Re-did versioning to follow semantic versioning
* Add validation of class parameters
##2011-05-24 - Version 0.1.0
Jeff McCune <jeff@puppetlabs.com>
* Default to JDK version 6u25
##2011-05-24 - Version 0.0.1
Jeff McCune <jeff@puppetlabs.com>
* Initial release

27
Gemfile Normal file
View File

@@ -0,0 +1,27 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :test do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'serverspec', :require => false
gem 'puppet-lint', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
# vim:ft=ruby

View File

@@ -1,11 +0,0 @@
name 'puppetlabs-java'
version '0.3.0'
source 'git://github.com/puppetlabs/puppetlabs-java'
author 'puppetlabs'
license 'Apache'
summary 'Manage the official Java runtime'
description 'Manage the official Java runtime'
project_page 'https://github.com/puppetlabs/puppetlabs-java'
## Add dependencies, if any:
dependency 'puppetlabs/stdlib', '>= 0.1.6'

View File

@@ -1,5 +1,96 @@
# Java #
#java
Manage the Java runtime for use with other application software.
####Table of Contents
Currently this deploys the correct Java package on a variety of platforms.
1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with the java module](#setup)
* [Beginning with the java module](#beginning-with-the-java-module)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)
##Overview
Installs the correct Java package on various platforms.
##Module Description
The java module can automatically install Java jdk or jre on a wide variety of systems. Java is a base component for many software platforms, but Java system packages don't always follow packaging conventions. The java module simplifies the Java installation process.
##Setup
###Beginning with the java module
To install the correct Java package on your system, include the `java` class: `include java`.
##Usage
The java module installs the correct jdk or jre package on a wide variety of systems. By default, the module will install the jdk package, but you can set different installation parameters as needed. For example, to install jre instead of jdk, you would set the distribution parameter:
```
class { 'java':
distribution => 'jre',
}
```
##Reference
###Classes
####Public classes
* `java`: This is the module's main class, which installs and manages the Java package.
####Private classes
* `java::params`: Builds a hash of jdk/jre packages for all compatible operating systems.
* `java::config`: Configures the Java alternatives on Debian systems.
###Parameters:
The following parameters are available in the java module:
* `distribution`: The Java distribution to install. Can be 'jdk','jre', or, where the platform supports alternative packages, 'sun-jdk', 'sun-jre', 'oracle-jdk', 'oracle-jre'. Defaults to 'jdk'.
* `version`: The version of Java to install, if you want to ensure a particular version. By default, the module ensures that Java is present but does not require a specific version.
* `package`: The name of the Java package. This is configurable in case you want to install a non-standard Java package. If not set, the module will install the appropriate package for the `distribution` parameter and target platform. If you set `package`, the `distribution` parameter will do nothing.
* `java_alternative`: The name of the Java alternative to use on Debian systems. The command 'update-java-alternatives -l' will show which choices are available. If you specify a particular package, you will usually want to specify which Java alternative to use. If you set this parameter, you also need to set the `java_alternative_path`.
* `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.
##Limitations
This module cannot guarantee installation of Java versions that are not available on platform repositories.
Oracle Java packages are not included in Debian 7 and Ubuntu 12.04/14.04 repositories. To install Java on those systems, you'll need to package Oracle JDK/JRE, and then the module will be able to install the package. For more information on how to package Oracle JDK/JRE, see the [Debian wiki](http://wiki.debian.org/JavaPackage).
This module is officially [supported](https://forge.puppetlabs.com/supported) for the following Java versions and platforms:
OpenJDK is supported on:
* Red Hat Enterprise Linux (RHEL) 5, 6, 7
* CentOS 5, 6, 7
* Oracle Linux 6, 7
* Scientific Linux 5, 6
* Debian 6, 7
* Ubuntu 10.04, 12.04, 14.04
* Solaris 11
* SLES 11 SP1, 12
Sun Java is supported on:
* Debian 6
##Development
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We cant access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
You can read the complete module contribution guide on the [Puppet Labs wiki](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing).
##Contributors
The list of contributors can be found at: [https://github.com/puppetlabs/puppetlabs-java/graphs/contributors](https://github.com/puppetlabs/puppetlabs-java/graphs/contributors).

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

@@ -5,7 +5,10 @@
# Parameters:
#
# [*distribution*]
# The java distribution to install. Can be one of "jdk" or "jre".
# 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
@@ -15,6 +18,19 @@
# 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:
#
# Requires:
@@ -22,32 +38,58 @@
# Sample Usage:
#
class java(
$distribution = 'jdk',
$version = 'present',
$package = undef,
$distribution = 'jdk',
$version = 'present',
$package = undef,
$java_alternative = undef,
$java_alternative_path = undef
) {
include java::params
validate_re($version, 'present|installed|latest|^[._0-9a-zA-Z:-]+$')
validate_re($version, 'present|installed|latest|^[.+_0-9a-zA-Z:-]+$')
case $distribution {
default: { fail('distribution must be one of jdk, jre') }
'jdk': {
$default_package_name = $java::params::jdk_package
}
'jre': {
$default_package_name = $java::params::jre_package
}
if has_key($java::params::java, $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.")
}
$use_java_package_name = $package ? {
default => $package,
undef => $default_package_name,
default => $package,
}
## 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 ? {
undef => $use_java_package_name ? {
$default_package_name => $default_alternative,
default => undef,
},
default => $java_alternative,
}
## Same logic as $java_alternative above.
$use_java_alternative_path = $java_alternative_path ? {
undef => $use_java_package_name ? {
$default_package_name => $default_alternative_path,
default => undef,
},
default => $java_alternative_path,
}
anchor { 'java::begin:': }
->
package { 'java':
ensure => $version,
name => $use_java_package_name,
}
->
class { 'java::config': }
-> anchor { 'java::end': }
}

View File

@@ -1,8 +1,15 @@
# Class: java::params
#
# This class sets the value of two variables, jdk_package and jre_package,
# appropriate for the client system in question.
# 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 {
@@ -10,37 +17,130 @@ class java::params {
'RedHat': {
case $::operatingsystem {
default: { fail("unsupported os ${::operatingsystem}") }
'RedHat', 'CentOS': {
'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'
}
'Fedora': {
$jdk_package = 'java'
$jre_package = 'java'
'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}") }
'squeeze', 'lucid': {
$jdk_package = 'openjdk-6-jdk'
$jre_package = 'openjdk-6-jre-headless'
'lenny', 'squeeze', 'lucid', 'natty': {
$java = {
'jdk' => {
'package' => 'openjdk-6-jdk',
'alternative' => "java-6-openjdk-${architecture}",
'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-${architecture}",
'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', 'precise': {
$jdk_package = 'openjdk-7-jdk'
$jre_package = 'openjdk-7-jre-headless'
'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': {
$jdk_package = 'developer/java/jdk-7'
$jre_package = 'runtime/java/jre-7'
$java = {
'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'
case $::operatingsystem {
default: {
$jdk_package = 'java-1_6_0-ibm-devel'
$jre_package = 'java-1_6_0-ibm'
}
"SLES": {
case $::operatingsystemmajrelease{
default: {
$jdk_package = 'java-1_6_0-ibm-devel'
$jre_package = 'java-1_6_0-ibm'
}
'12': {
$jdk_package = 'java-1_7_0-openjdk-devel'
$jre_package = 'java-1_7_0-openjdk'
}
}
}
'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, },
}
}
}
}

86
metadata.json Normal file
View File

@@ -0,0 +1,86 @@
{
"name": "puppetlabs-java",
"version": "1.2.0",
"author": "puppetlabs",
"summary": "Manage the official Java runtime",
"license": "Apache",
"source": "git://github.com/puppetlabs/puppetlabs-java",
"project_page": "https://github.com/puppetlabs/puppetlabs-java",
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"10.04",
"12.04",
"14.04"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11 SP1",
"12"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"11"
]
}
],
"requirements": [
{
"name": "pe",
"version_requirement": "3.x"
},
{
"name": "puppet",
"version_requirement": "3.x"
}
],
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 2.4.0"
}
]
}

View File

@@ -0,0 +1,212 @@
require 'spec_helper_acceptance'
#RedHat, CentOS, Scientific, Oracle prior to 5.0 : Sun Java JDK/JRE 1.6
#RedHat, CentOS, Scientific, Oracle 5.0 < x < 6.3 : OpenJDK Java JDK/JRE 1.6
#RedHat, CentOS, Scientific, Oracle after 6.3 : OpenJDK Java JDK/JRE 1.7
#Debian 5/6 & Ubuntu 10.04/11.04 : OpenJDK Java JDK/JRE 1.6 or Sun Java JDK/JRE 1.6
#Debian 7/Jesse & Ubuntu 12.04 - 14.04 : OpenJDK Java JDK/JRE 1.7 or Oracle Java JDK/JRE 1.6
#Solaris (what versions?) : Java JDK/JRE 1.7
#OpenSuSE : OpenJDK Java JDK/JRE 1.7
#SLES : IBM Java JDK/JRE 1.6
# C14677
# C14678
# C14679
# C14680
# C14681
# C14682
# C14684
# C14687
# C14692
# C14696
# C14697
# C14700 check on solaris 11
# C14701 check on sles 11
# C14703
# C14723 Where is oracle linux 5?
# C14724 Where is oracle linux 5?
# C14771 Where is redhat 7? Centos 7?
describe "installing java", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe "jre" do
it 'should install jre' do
pp = <<-EOS
class { 'java':
distribution => 'jre',
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
describe "jdk" do
it 'should install jdk' do
pp = <<-EOS
class { 'java': }
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end
# C14686
describe 'sun', :if => (fact('operatingsystem') == 'Debian' and fact('operatingsystemrelease').match(/(5|6)/)) do
before :all do
pp = <<-EOS
file_line { 'non-free source':
path => '/etc/apt/sources.list',
match => "deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main",
line => "deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free",
}
EOS
apply_manifest(pp)
shell('apt-get update')
shell('echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true" | debconf-set-selections')
shell('echo "sun-java6-jre shared/accepted-sun-dlj-v1-1 select true" | debconf-set-selections')
end
describe 'jre' do
it 'should install sun-jre' do
pp = <<-EOS
class { 'java':
distribution => 'sun-jre',
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
describe 'jdk' do
it 'should install sun-jdk' do
pp = <<-EOS
class { 'java':
distribution => 'sun-jdk',
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end
# C14704
# C14705
# C15006
describe 'oracle', :if => (
(fact('operatingsystem') == 'Debian') and (fact('operatingsystemrelease').match(/^7/)) or
(fact('operatingsystem') == 'Ubuntu') and (fact('operatingsystemrelease').match(/^12\.04/)) or
(fact('operatingsystem') == 'Ubuntu') and (fact('operatingsystemrelease').match(/^14\.04/))
) do
# not supported
# The package is not available from any sources, but if a customer
# custom-builds the package using java-package and adds it to a local
# repository, that is the intention of this version ability
describe 'jre' do
it 'should install oracle-jre' do
pp = <<-EOS
class { 'java':
distribution => 'oracle-jre',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
end
describe 'jdk' do
it 'should install oracle-jdk' do
pp = <<-EOS
class { 'java':
distribution => 'oracle-jdk',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
end
end
describe 'failure cases' do
# C14711
it 'should fail to install java with an incorrect version' do
pp = <<-EOS
class { 'java':
version => '14.5',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14712
it 'should fail to install java with a blank version' do
pp = <<-EOS
class { 'java':
version => '',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14713
it 'should fail to install java with an incorrect distribution' do
pp = <<-EOS
class { 'java':
distribution => 'xyz',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14714
it 'should fail to install java with a blank distribution' do
pp = <<-EOS
class { 'java':
distribution => '',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14715
it 'should fail to install java with an incorrect package' do
pp = <<-EOS
class { 'java':
package => 'xyz',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14715
it 'should fail to install java with an incorrect package' do
pp = <<-EOS
class { 'java':
package => 'xyz',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
# C14717
# C14719
# C14725
it 'should fail on debian when passed fake java_alternative and path' do
pp = <<-EOS
class { 'java':
java_alternative => 'whatever',
java_alternative_path => '/whatever',
}
EOS
if fact('osfamily') == 'Debian'
apply_manifest(pp, :expect_failures => true)
else
apply_manifest(pp, :catch_failures => true)
end
end
end

View File

@@ -0,0 +1,15 @@
HOSTS:
'centos-5-vcloud':
roles:
- master
platform: el-5-x86_64
hypervisor: vcloud
template: centos-5-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,12 @@
HOSTS:
centos-59-x64:
roles:
- master
- database
- console
platform: el-5-x86_64
box : centos-59-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: pe

View File

@@ -0,0 +1,10 @@
HOSTS:
centos-59-x64:
roles:
- master
platform: el-5-x86_64
box : centos-59-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git

View File

@@ -0,0 +1,15 @@
HOSTS:
'centos-6-vcloud':
roles:
- master
platform: el-6-x86_64
hypervisor: vcloud
template: centos-6-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,10 @@
HOSTS:
centos-64-x64:
roles:
- master
platform: el-6-x86_64
box : centos-64-x64-fusion503-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box
hypervisor : fusion
CONFIG:
type: foss

View File

@@ -0,0 +1,12 @@
HOSTS:
centos-64-x64:
roles:
- master
- database
- dashboard
platform: el-6-x86_64
box : centos-64-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: pe

View File

@@ -0,0 +1,10 @@
HOSTS:
centos-64-x64:
roles:
- master
platform: el-6-x86_64
box : centos-64-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: foss

View File

@@ -0,0 +1,10 @@
HOSTS:
centos-65-x64:
roles:
- master
platform: el-6-x86_64
box : centos-65-x64-vbox436-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
hypervisor : vagrant
CONFIG:
type: foss

View File

@@ -0,0 +1,15 @@
HOSTS:
'centos-7-vcloud':
roles:
- master
platform: el-7-x86_64
hypervisor: vcloud
template: centos-7-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,15 @@
HOSTS:
'debian-6-amd64':
roles:
- master
platform: debian-6-amd64
hypervisor: vcloud
template: debian-6-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,10 @@
HOSTS:
debian-607-x64:
roles:
- master
platform: debian-6-amd64
box : debian-607-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git

View File

@@ -0,0 +1,15 @@
HOSTS:
'debian-7-amd64':
roles:
- master
platform: debian-7-amd64
hypervisor: vcloud
template: debian-7-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,10 @@
HOSTS:
debian-70rc1-x64:
roles:
- master
platform: debian-7-amd64
box : debian-70rc1-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git

View File

@@ -0,0 +1,10 @@
HOSTS:
centos-64-x64:
roles:
- master
platform: el-6-x86_64
box : centos-64-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: foss

View File

@@ -0,0 +1,10 @@
HOSTS:
fedora-18-x64:
roles:
- master
platform: fedora-18-x86_64
box : fedora-18-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git

View File

@@ -0,0 +1,15 @@
HOSTS:
'redhat-7-vcloud':
roles:
- master
platform: el-7-x86_64
hypervisor: vcloud
template: redhat-7-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,16 @@
HOSTS:
'sles-11-vcloud':
roles:
- master
platform: sles-11-x86_64
hypervisor: vcloud
template: sles-11-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,10 @@
HOSTS:
sles-11sp1-x64:
roles:
- master
platform: sles-11-x86_64
box : sles-11sp1-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git

View File

@@ -0,0 +1,15 @@
HOSTS:
'solaris-11-vcloud':
roles:
- master
platform: solaris-11-i386
hypervisor: vcloud
template: solaris-11-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,15 @@
HOSTS:
'ubuntu-1004-amd64':
roles:
- master
platform: ubuntu-10.04-amd64
hypervisor: vcloud
template: ubuntu-1004-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,15 @@
HOSTS:
'ubuntu-1404-amd64':
roles:
- master
platform: ubuntu-14.04-amd64
hypervisor: vcloud
template: ubuntu-1404-x86_64
CONFIG:
type: foss
ssh:
keys: "~/.ssh/id_rsa-acceptance"
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/

View File

@@ -0,0 +1,10 @@
HOSTS:
ubuntu-server-10044-x64:
roles:
- master
platform: ubuntu-10.04-amd64
box : ubuntu-server-10044-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: foss

View File

@@ -0,0 +1,10 @@
HOSTS:
ubuntu-server-12042-x64:
roles:
- master
platform: ubuntu-12.04-amd64
box : ubuntu-server-12042-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: foss

View File

@@ -0,0 +1,11 @@
HOSTS:
ubuntu-server-1404-x64:
roles:
- master
platform: ubuntu-14.04-amd64
box : puppetlabs/ubuntu-14.04-64-nocm
box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
hypervisor : vagrant
CONFIG:
log_level : debug
type: git

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

@@ -0,0 +1,154 @@
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', :architecture => 'amd64',} }
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-amd64 --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
describe 'incompatible OSs' do
[
{
# C14706
:osfamily => 'windows',
:operatingsystem => 'windows',
:operatingsystemrelease => '8.1',
},
{
# C14707
:osfamily => 'Darwin',
:operatingsystem => 'Darwin',
:operatingsystemrelease => '13.3.0',
},
{
# C14708
:osfamily => 'AIX',
:operatingsystem => 'AIX',
:operatingsystemrelease => '7100-02-00-000',
},
{
# C14708
:osfamily => 'AIX',
:operatingsystem => 'AIX',
:operatingsystemrelease => '6100-07-04-1216',
},
{
# C14708
:osfamily => 'AIX',
:operatingsystem => 'AIX',
:operatingsystemrelease => '5300-12-01-1016',
},
].each do |facts|
let(:facts) { facts }
it "should fail on #{facts[:operatingsystem]} #{facts[:operatingsystemrelease]}" do
expect { subject }.to raise_error Puppet::Error, /unsupported platform/
end
end
end
end

1
spec/spec_helper.rb Normal file
View File

@@ -0,0 +1 @@
require 'puppetlabs_spec_helper/module_spec_helper'

View File

@@ -0,0 +1,54 @@
require 'beaker-rspec'
UNSUPPORTED_PLATFORMS = [ "Darwin", "windows" ]
unless ENV["RS_PROVISION"] == "no" or ENV["BEAKER_provision"] == "no"
# This will install the latest available package on el and deb based
# systems fail on windows and osx, and install via gem on other *nixes
foss_opts = { :default_action => 'gem_install' }
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
hosts.each do |host|
if host["platform"] =~ /solaris/
on host, "echo 'export PATH=/opt/puppet/bin:/var/ruby/1.8/gem_home/bin:${PATH}' >> ~/.bashrc"
end
unless host.is_pe?
on host, "/bin/mkdir -p #{host["puppetpath"]}"
on host, "/bin/echo '' > #{host["hieraconf"]}"
end
on host, "mkdir -p #{host["distmoduledir"]}"
if host['platform'] =~ /sles-1/i || host['platform'] =~ /solaris-1/i
get_stdlib = <<-stdlib
package{'wget':}
exec{'download':
command => "wget -P /root/ https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.3.2.tar.gz --no-check-certificate",
path => ['/opt/csw/bin/','/usr/bin/']
}
stdlib
apply_manifest_on(host, get_stdlib)
# have to use force otherwise it checks ssl cert even though it is a local file
on host, puppet('module install /root/puppetlabs-stdlib-4.3.2.tar.gz --force')
else
on host, puppet("module install puppetlabs-stdlib")
# For test support
on host, puppet("module install puppetlabs-apt")
end
end
end
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), ".."))
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module
hosts.each do |host|
copy_module_to(host, :source => proj_root, :module_name => "java")
end
end
end