Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Download JDK package from official site. #65

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
script: "./script/cibuild"
gemfile: "this/does/not/exist"
gemfile: "Gemfile"
rvm:
- "1.8.7"
- "1.9.3"
- "2.3.3"
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem "cardboard", "~> 2.1.0"
gem "cardboard23", "~> 3.0.0b"
161 changes: 97 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,112 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.8)
addressable (2.3.6)
ansi (1.4.3)
boxen (2.7.0)
ansi (~> 1.4)
hiera (~> 1.0)
highline (~> 1.6)
json_pure (>= 1.7.7, < 2.0)
librarian-puppet (~> 1.0.0)
octokit (~> 2.7, >= 2.7.1)
puppet (~> 3.7)
cardboard (2.1.0)
boxen (~> 2.1)
puppet-lint (~> 0.3)
puppetlabs_spec_helper (~> 0.4)
rspec-puppet (~> 1.0)
diff-lcs (1.2.5)
facter (2.3.0)
CFPropertyList (~> 2.2.6)
faraday (0.9.0)
addressable (2.3.8)
ansi (1.5.0)
boxen23 (4.0.0a)
ansi (~> 1.5)
hiera (~> 3.4)
highline (~> 1.7)
json_pure (>= 1.8.3, < 2.0)
octokit (~> 3.8, >= 3.8.0)
puppet (~> 4.10)
cardboard23 (3.0.0b)
boxen23 (= 4.0.0a)
librarian-puppet (~> 2.2)
librarianp (~> 0.6)
puppet-lint (~> 2.3)
puppetlabs_spec_helper (~> 2.4)
rspec-puppet (~> 2.6)
diff-lcs (1.3)
facter (2.5.7)
facter (2.5.7-universal-darwin)
CFPropertyList (~> 2.2)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
hiera (1.3.4)
json_pure
highline (1.6.21)
json (1.8.1)
json_pure (1.8.1)
librarian (0.1.2)
highline
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
fast_gettext (1.1.2)
gettext (3.2.9)
locale (>= 2.0.5)
text (>= 1.3.0)
gettext-setup (0.34)
fast_gettext (~> 1.1.0)
gettext (>= 3.0.2, < 3.3.0)
locale
hiera (3.6.0)
highline (1.7.10)
json_pure (1.8.6)
librarian-puppet (2.2.3)
librarianp (>= 0.6.3)
puppet_forge (~> 2.1)
rsync
librarianp (0.6.4)
thor (~> 0.15)
librarian-puppet (1.0.9)
json
librarian (>= 0.1.2)
metaclass (0.0.4)
mocha (1.1.0)
metaclass (~> 0.0.1)
multipart-post (2.0.0)
octokit (2.7.2)
sawyer (~> 0.5.2)
puppet (3.7.3)
facter (> 1.6, < 3)
hiera (~> 1.0)
json_pure
puppet-lint (0.3.2)
puppet-syntax (1.3.0)
rake
puppetlabs_spec_helper (0.8.2)
mocha
puppet-lint
puppet-syntax
locale (2.1.3)
minitar (0.9)
mocha (1.11.2)
multipart-post (2.1.1)
octokit (3.8.0)
sawyer (~> 0.6.0, >= 0.5.3)
pathspec (0.2.1)
puppet (4.10.12)
facter (> 2.0, < 4)
gettext-setup (>= 0.10, < 1)
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
locale (~> 2.1)
puppet (4.10.12-universal-darwin)
CFPropertyList (~> 2.2.6)
facter (> 2.0, < 4)
gettext-setup (>= 0.10, < 1)
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
locale (~> 2.1)
puppet-lint (2.4.2)
puppet-syntax (2.6.0)
rake
rspec
rspec-puppet
rake (10.4.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
puppet_forge (2.3.4)
faraday (>= 0.9.0, < 0.18.0, != 0.13.1)
faraday_middleware (>= 0.9.0, < 0.15.0)
gettext-setup (~> 0.11)
minitar
semantic_puppet (~> 1.0)
puppetlabs_spec_helper (2.14.1)
mocha (~> 1.0)
pathspec (~> 0.2.1)
puppet-lint (~> 2.0)
puppet-syntax (~> 2.0)
rspec-puppet (~> 2.0)
rake (13.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-puppet (1.0.1)
rspec-support (~> 3.9.0)
rspec-puppet (2.7.8)
rspec
rspec-support (3.1.2)
sawyer (0.5.5)
rspec-support (3.9.3)
rsync (1.0.9)
sawyer (0.6.0)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
thor (0.19.1)
semantic_puppet (1.0.2)
text (1.3.1)
thor (0.20.3)

PLATFORMS
ruby
universal-darwin-17

DEPENDENCIES
cardboard (~> 2.1.0)
cardboard23 (~> 3.0.0b)

BUNDLED WITH
2.1.4
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Installs Java 7 and unlimited key length security policy files..
Installs Oracle Java 8.


## Usage
Expand All @@ -14,18 +14,19 @@ include java

## Parameters

You can customise this module by configuring some optional class parameters. Usually you'd do this via Hiera, but you could also explicitly pass those parameters in puppet code like `class { 'java': update_version => '42', }`.
You can customise this module by configuring some optional class parameters. Usually you'd do this via Hiera, but you could also explicitly pass those parameters in puppet code like `class { 'java': update_version => '152', minor_Version => 'b16', hash_versoin => 'aa0333dd3019491ca4f6ddbe78cdb6d0' }`.

* `update_version`: The 'update' part of the JRE/JDK version to install. For example, if you specify `51`, the module would install java 7u51
* `base_download_url`: A base path from which the JRE and JDK packages should be downloaded. For example, if you specify `https://myorg.example/dist/java`, this module would download the jre from `https://myorg.example/dist/java/jre-7u51-macosx-x64.dmg`.
* `update_version`: The 'update' part of the JDK version to install. For example, if you specify `152`, the module would install java 8u152
* `minor_version`, `hash_version`: The 'minor' part of the JDK download URL. For example download URL is http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-macosx-x64.dmg, minor verson is 'b16'.

All of these parameters have sensible defaults, and are provided if you need more control.

Example hiera data in YAML:

```yaml
java::update_version: '51'
java::base_download_url: 'https://myorg.example/dist/java'
java::update_version: '152'
java::minor_version: 'b16'
java::hash_version: 'aa0333dd3019491ca4f6ddbe78cdb6d0'
```

## Required Puppet Modules
Expand Down
26 changes: 0 additions & 26 deletions manifests/idrac7.pp

This file was deleted.

76 changes: 19 additions & 57 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,74 +1,36 @@
# Public: installs java jre-7u51 and JCE unlimited key size policy files
# Public: installs java jdk and JCE unlimited key size policy files
#
# Examples
#
# include java

class java (
$update_version = '71',
$base_download_url = 'https://s3.amazonaws.com/boxen-downloads/java'
$major_version = '14.0.1',
$minor_version = '7',
$hash_version = '664493ef4a6946b186ff29eb326336a2'
) {
include boxen::config

$jre_url = "${base_download_url}/jre-7u${update_version}-macosx-x64.dmg"
$jdk_url = "${base_download_url}/jdk-7u${update_version}-macosx-x64.dmg"
$wrapper = "${boxen::config::bindir}/java"
$jdk_dir = "/Library/Java/JavaVirtualMachines/jdk1.7.0_${update_version}.jdk"
$sec_dir = "${jdk_dir}/Contents/Home/jre/lib/security"

if ((versioncmp($::macosx_productversion_major, '10.10') >= 0) and
versioncmp($update_version, '71') < 0)
{
fail('Yosemite Requires Java 7 with a patch level >= 71 (Bug JDK-8027686)')
}
$jdk_download_url = "https://download.oracle.com/otn-pub/java/jdk/${major_version}+${minor_version}/${hash_version}"
$jdk_package = "jdk-${major_version}_osx-x64_bin.dmg"
$jdk_dir = '/Library/Java/JavaVirtualMachines'

file { $wrapper:
source => 'puppet:///modules/java/java.sh',
mode => '0755'
source => 'puppet:///modules/java/java.sh',
mode => '0755',
}

if (versioncmp($::java_jre_version, '1.8.0') < 0) {
package {
"jre-7u${update_version}.dmg":
ensure => present,
alias => 'java-jre',
provider => pkgdmg,
source => $jre_url ;
}
exec { "download ${jdk_package}":
command => "wget --quiet --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' ${jdk_download_url}/${jdk_package} -P ${jdk_dir}",
user => root,
creates => "${jdk_dir}/${jdk_package}",
require => Package['wget'],
}

if (versioncmp($::java_version, '1.8.0') < 0) {
package {
"jdk-7u${update_version}.dmg":
ensure => present,
alias => 'java',
provider => pkgdmg,
source => $jdk_url ;
}

# Allow 'large' keys locally.
# http://www.ngs.ac.uk/tools/jcepolicyfiles
file { $sec_dir:
ensure => 'directory',
owner => 'root',
group => 'wheel',
mode => '0775',
require => Package['java']
}

file { "${sec_dir}/local_policy.jar":
source => 'puppet:///modules/java/local_policy.jar',
owner => 'root',
group => 'wheel',
mode => '0664',
require => File[$sec_dir]
}

file { "${sec_dir}/US_export_policy.jar":
source => 'puppet:///modules/java/US_export_policy.jar',
owner => 'root',
group => 'wheel',
mode => '0664',
require => File[$sec_dir]
}
package { $jdk_package:
provider => pkgdmg,
source => "${jdk_dir}/${jdk_package}",
require => Exec["download ${jdk_package}"],
}
}
6 changes: 5 additions & 1 deletion script/cardboard-exec
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ BUNDLE=.bundle
BIN=$BUNDLE/binstubs
SCRIPT=$(basename "$0")

BUNDLE_ARGS="--binstubs $BIN --path $BUNDLE --quiet"
BUNDLE_ARGS="--quiet"
[ "cibuild" = "$SCRIPT" ] && BUNDLE_ARGS="$BUNDLE_ARGS --no-quiet"

rm -rf {$BIN,$BUNDLE/config}
bundle config path $BUNDLE
set +e
bundle binstubs --path=$BIN
set -e
bundle install $BUNDLE_ARGS

bundle exec cardboard bootstrap
Expand Down
28 changes: 0 additions & 28 deletions spec/classes/java_idrac7_spec.rb

This file was deleted.

Loading