Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.gradle
/metadata.json
/.rvmrc
build
pkg/
Expand All @@ -10,3 +9,4 @@ spec/fixtures
.bundle
vendor
.gemfile.lock
Gemfile.lock
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: ruby
bundler_args: --without development
rvm:
- 1.8.7
- 1.9.3
- 2.1.4
script:
- "bundle exec rake lint spec SPEC_OPTS='--format documentation'"
env:
- PUPPET_VERSION="~> 2.6.0"
- PUPPET_VERSION="~> 2.7.0"
- PUPPET_VERSION="~> 3.0.0"
- PUPPET_VERSION="~> 3.1.0"
Expand All @@ -17,18 +17,14 @@ matrix:
- rvm: 1.8.7
env: PUPPET_VERSION="~> 4.2"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 2.6.0"
gemfile: .gemfile
- rvm: 2.1.4
env: PUPPET_VERSION="~> 2.6.0"
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.1.4
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.1.4
env: PUPPET_VERSION="~> 3.0.0"
- rvm: 2.1.4
env: PUPPET_VERSION="~> 3.1.0"

gemfile: .gemfile
sudo: false
notifications:
email:
Expand Down
19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source 'https://rubygems.org'

puppetversion = ENV['PUPPET_VERSION']

is_ruby18 = RUBY_VERSION.start_with? '1.8'

if is_ruby18
gem 'rspec', "~> 3.1.0", :require => false
gem 'rake', '~> 10.5.0', :require => false
end
gem 'puppet', puppetversion, :require => false
gem 'puppet-lint'
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'rspec-puppet'
gem 'metadata-json-lint'

group :development do
gem 'puppet-blacksmith'
end
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#java

[![Build Status](https://travis-ci.org/example42/puppet-java.png?branch=master)](https://travis-ci.org/example42/puppet-java)

####Table of Contents

1. [Overview](#overview)
2. [Setup](#setup)
3. [Usage](#usage)


##Overview

This module installs java (JDK + JRE) versions

##Setup

###Setup Requirements
* PuppetLabs [stdlib module](https://github.com/puppetlabs/puppetlabs-stdlib)
* Example42 [puppet module](https://github.com/example42/puppi)

##Usage

The main class is used only.

class { 'java':
jdk => false, # default - whether to install the jdk or the jre only
version => '6', # Java version to install
}

##Development

Pull requests (PR) and bug reports via GitHub are welcomed.

When submitting PR please follow these quidelines:
- Provide puppet-lint compliant code
- If possible provide rspec tests
- Follow the module style and stdmod naming standards

When submitting bug report please include or link:
- The Puppet code that triggers the error
- The output of facter on the system where you try it
- All the relevant error logs
- Any other information useful to undestand the context

14 changes: 12 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,30 @@
default => '',
}
$real_package = $package ? {
'' => $::operatingsystem ? {
'' => $::operatingsystem ? {
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jre${headless_suffix}",
/(?i:SLES)/ => "java-1_${version}_0-ibm",
/(?i:OpenSuSE)/ => "java-1_${version}_0-openjdk",
/(?i:Solaris)/ => $::operatingsystemmajrelease ? {
'10' => "CSWjre${version}",
'11' => "jre-${version}",
'5' => "jre-${version}",
},
default => "java-1.${version}.0-openjdk",
},
default => $package,
}

$real_package_jdk = $package_jdk ? {
'' => $::operatingsystem ? {
'' => $::operatingsystem ? {
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jdk",
/(?i:SLES)/ => "java-1_${version}_0-ibm",
/(?i:OpenSuSE)/ => "java-1_${version}_0-openjdk-devel",
/(?i:Solaris)/ => $::operatingsystemmajrelease ? {
'10' => "CSWjdk${version}",
'11' => "jdk-${version}",
'5' => "jdk-${version}",
},
default => "java-1.${version}.0-openjdk-devel",
},
default => $package_jdk,
Expand Down
18 changes: 13 additions & 5 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,29 @@
default => '',
}
$real_package = $package ? {
'' => $bool_jdk ? {
false => $::operatingsystem ? {
'' => $bool_jdk ? {
false => $::operatingsystem ? {
/(?i:RedHat|Centos|Fedora|Scientific|Amazon|Linux)/ => "java-1.${version}.0-openjdk",
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jre${headless_suffix}",
/(?i:SLES)/ => "java-1_${version}_0-ibm",
/(?i:OpenSuSE)/ => "java-1_${version}_0-openjdk",
/(?i:Solaris)/ => "runtime/java/jre-${version}",
/(?i:Solaris)/ => $::operatingsystemmajrelease ? {
'10' => "CSWjre${version}",
'11' => "runtime/java/jre-${version}",
'5' => "runtime/java/jre-${version}",
},
default => fail("OperatingSystem ${::operatingsystem} not supported"),
},
true => $::operatingsystem ? {
true => $::operatingsystem ? {
/(?i:RedHat|Centos|Fedora|Scientific|Amazon|Linux)/ => "java-1.${version}.0-openjdk-devel",
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jdk",
/(?i:SLES)/ => "java-1_${version}_0-ibm",
/(?i:OpenSuSE)/ => "java-1_${version}_0-openjdk-devel",
/(?i:Solaris)/ => "developer/java/jdk-${version}",
/(?i:Solaris)/ => $::operatingsystemmajrelease ? {
'10' => "CSWjdk${version}",
'11' => "developer/java/jdk-${version}",
'5' => "developer/java/jdk-${version}",
},
default => fail("OperatingSystem ${::operatingsystem} not supported"),
}
},
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
$java_home_base = $::operatingsystem ? {
/(?i:SLES|OpenSuSE)/ => '/usr/lib/java',
/(?i:Ubuntu|Debian|Mint)/ => '/usr/lib/jvm',
/(?i:Solaris)/ => $::operatingsystemmajrelease ? {
'10' => '/opt/csw/java',
'11' => '/usr/java',
'5' => '/usr/java',
},
default => '/usr/lib/jvm',
}

Expand Down
69 changes: 69 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "example42-java",
"version": "2.1.0",
"summary": "Puppet module to manage Java",
"license": "Apache-2.0",
"author": "Alessandro Franceschi, Martin Alfke",
"checksums": {
},
"source": "https://github.com/example42/puppet-java",
"project_page": "https://github.com/example42/puppet-java",
"issues_url": "https://github.com/example42/puppet-java/issues",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Centos",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10",
"11"
]
}
],
"requirements": [
{
"name": "pe",
"version_requirement": ">= 3.0.0 < 5.0.0"
},
{
"name": "puppet",
"version_requirement": ">= 3.0.0 < 5.0.0"
}
],
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 3.2.0 < 5.0.0"
},
{
"name": "example42/puppi",
"version_requirement": ">= 2.0.0"
},
{
"name": "puppetlabs/concat",
"version_requirement": ">= 1.0.0"
}
]
}