From 29d18d1e5351630ed2def44998fa9a7f15e19320 Mon Sep 17 00:00:00 2001 From: n0ts Date: Wed, 21 Oct 2015 17:56:55 +0900 Subject: [PATCH 01/11] Download JDK from official site --- Gemfile.lock | 3 ++ README.md | 10 ++--- manifests/init.pp | 64 ++++++++------------------------ spec/classes/java_idrac7_spec.rb | 1 + spec/classes/java_spec.rb | 21 +++-------- 5 files changed, 30 insertions(+), 69 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 98b1f9a..4685881 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,3 +78,6 @@ PLATFORMS DEPENDENCIES cardboard (~> 2.1.0) + +BUNDLED WITH + 1.10.6 diff --git a/README.md b/README.md index dd65c5d..651909d 100644 --- a/README.md +++ b/README.md @@ -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 Java 8. ## Usage @@ -16,16 +16,16 @@ include java 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', }`. -* `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 `65`, the module would install java 8u65 +* `minor_version`: The 'minor' part of the JDK download URL. For example download URL is http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-macosx-x64.dmg, minor verson is 'b17'. 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: '65' +java::minor_version: 'b17' ``` ## Required Puppet Modules diff --git a/manifests/init.pp b/manifests/init.pp index 2ed7823..481b569 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,19 +1,19 @@ -# 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' + $update_version = '65', + $minor_version = 'b17' ) { include boxen::config + include wget - $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" + $jdk_download_url = "http://download.oracle.com/otn-pub/java/jdk/8u${update_version}-${minor_version}" + $jdk_package = "jdk-8u${update_version}-macosx-x64.dmg" + $jdk_dir = '/Library/Java/JavaVirtualMachines' if ((versioncmp($::macosx_productversion_major, '10.10') >= 0) and versioncmp($update_version, '71') < 0) @@ -26,49 +26,15 @@ 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 ${update_version}": + 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 ${update_version}": + provider => 'pkgdmg', + source => "${jdk_dir}/${jdk_package}", } } diff --git a/spec/classes/java_idrac7_spec.rb b/spec/classes/java_idrac7_spec.rb index 7bbdd15..7bf7642 100644 --- a/spec/classes/java_idrac7_spec.rb +++ b/spec/classes/java_idrac7_spec.rb @@ -5,6 +5,7 @@ it do should contain_class('java') + should include_class('wget') ['.java', '.java/deployment', '.java/deployment/security'].each do |dir| should contain_file("/Users/testuser/#{dir}").with({ diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index bb7a317..aecb4d0 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -4,27 +4,18 @@ let(:facts) { default_test_facts } let(:params) { { - :update_version => '42', - :base_download_url => 'https://downloads.test/java' + :update_version => '65', + :minor_version => 'b17', } } it do should contain_class('boxen::config') + should contain_class('wget') - should contain_package('jre-7u42.dmg').with({ - :ensure => 'present', - :alias => 'java-jre', - :provider => 'pkgdmg', - :source => 'https://downloads.test/java/jre-7u42-macosx-x64.dmg' - }) + should contain_exec('download jdk 65') - should contain_package('jdk-7u42.dmg').with({ - :ensure => 'present', - :alias => 'java', - :provider => 'pkgdmg', - :source => 'https://downloads.test/java/jdk-7u42-macosx-x64.dmg' - }) + should contain_package('jdk 65') should contain_file('/test/boxen/bin/java').with({ :source => 'puppet:///modules/java/java.sh', @@ -36,7 +27,7 @@ let(:facts) { default_test_facts.merge({ :macosx_productversion_major => '10.10' }) } let(:params) { { - :update_version => '51', + :update_version => '65', } } it do From 91ba21e8e4574c6d7cfa3551233347f5afb6aaec Mon Sep 17 00:00:00 2001 From: n0ts Date: Thu, 22 Oct 2015 11:39:56 +0900 Subject: [PATCH 02/11] Fix test --- .travis.yml | 3 +-- manifests/idrac7.pp | 26 -------------------------- manifests/init.pp | 14 ++++---------- spec/classes/java_idrac7_spec.rb | 29 ----------------------------- spec/classes/java_spec.rb | 28 +++++++++++----------------- spec/fixtures/.gitignore | 2 ++ spec/fixtures/Puppetfile | 4 +++- spec/fixtures/hiera/common.yaml | 10 ++++++++++ spec/fixtures/hiera/hiera.yaml | 7 +++++++ spec/spec_helper.rb | 1 + 10 files changed, 39 insertions(+), 85 deletions(-) delete mode 100644 manifests/idrac7.pp delete mode 100644 spec/classes/java_idrac7_spec.rb create mode 100644 spec/fixtures/.gitignore create mode 100644 spec/fixtures/hiera/common.yaml create mode 100644 spec/fixtures/hiera/hiera.yaml diff --git a/.travis.yml b/.travis.yml index 25e19ee..c365f95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,4 @@ script: "./script/cibuild" gemfile: "this/does/not/exist" rvm: - - "1.8.7" - - "1.9.3" + - "2.0.0" diff --git a/manifests/idrac7.pp b/manifests/idrac7.pp deleted file mode 100644 index 78b99bd..0000000 --- a/manifests/idrac7.pp +++ /dev/null @@ -1,26 +0,0 @@ -# Public: Dell DRAC and Java 7 Certificate Fix -# http://people.binf.ku.dk/~hanne/b2evolution/blogs/index.php/2012/08/09/dell-idrac-7-will-not -# -# Examples -# -# include java::idrac7 -class java::idrac7 { - include java - - file { [ - "/Users/${::boxen_user}/.java", - "/Users/${::boxen_user}/.java/deployment", - "/Users/${::boxen_user}/.java/deployment/security" - ]: - ensure => directory, - mode => '0750'; - "/Users/${::boxen_user}/.java/deployment/security/trusted.certs": - ensure => file, - mode => '0640', - source => 'puppet:///modules/java/trusted.certs'; - "/Users/${::boxen_user}/.java/deployment/security/trusted.jssecerts": - ensure => file, - mode => '0640', - source => 'puppet:///modules/java/trusted.jssecerts'; - } -} diff --git a/manifests/init.pp b/manifests/init.pp index 481b569..e416ccf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,26 +15,20 @@ $jdk_package = "jdk-8u${update_version}-macosx-x64.dmg" $jdk_dir = '/Library/Java/JavaVirtualMachines' - 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)') - } - file { $wrapper: source => 'puppet:///modules/java/java.sh', mode => '0755' } - exec { "download jdk ${update_version}": + 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", + user => root, creates => "${jdk_dir}/${jdk_package}", require => Package['wget'], } - package { "jdk ${update_version}": + package { $jdk_package: provider => 'pkgdmg', - source => "${jdk_dir}/${jdk_package}", + source => "${jdk_dir}/${jdk_package}", } } diff --git a/spec/classes/java_idrac7_spec.rb b/spec/classes/java_idrac7_spec.rb deleted file mode 100644 index 7bf7642..0000000 --- a/spec/classes/java_idrac7_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'spec_helper' - -describe "java::idrac7" do - let(:facts) { default_test_facts } - - it do - should contain_class('java') - should include_class('wget') - - ['.java', '.java/deployment', '.java/deployment/security'].each do |dir| - should contain_file("/Users/testuser/#{dir}").with({ - :ensure => 'directory', - :mode => '0750' - }) - end - - should contain_file("/Users/testuser/.java/deployment/security/trusted.certs").with({ - :ensure => 'file', - :mode => '0640', - :source => 'puppet:///modules/java/trusted.certs' - }) - - should contain_file("/Users/testuser/.java/deployment/security/trusted.jssecerts").with({ - :ensure => 'file', - :mode => '0640', - :source => 'puppet:///modules/java/trusted.jssecerts' - }) - end -end diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index aecb4d0..797745f 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -13,27 +13,21 @@ should contain_class('boxen::config') should contain_class('wget') - should contain_exec('download jdk 65') - - should contain_package('jdk 65') - should contain_file('/test/boxen/bin/java').with({ :source => 'puppet:///modules/java/java.sh', :mode => '0755' }) - end - context 'fails when java version has Yosemite relevant bug' do - let(:facts) { default_test_facts.merge({ :macosx_productversion_major => '10.10' }) } - let(:params) { - { - :update_version => '65', - } - } - it do - expect { - should contain_class('java') - }.to raise_error(/Yosemite Requires Java 7 with a patch level >= 71 \(Bug JDK\-8027686\)/) - end + should contain_exec('download jdk-8u65-macosx-x64.dmg').with({ + :command => 'wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines', + :user => 'root', + :creates => '/Library/Java/JavaVirtualMachines/jdk-8u65-macosx-x64.dmg', + :require => 'Package[wget]', + }) + + should contain_package('jdk-8u65-macosx-x64.dmg').with({ + :provider => 'pkgdmg', + :source => '/Library/Java/JavaVirtualMachines/jdk-8u65-macosx-x64.dmg', + }) end end diff --git a/spec/fixtures/.gitignore b/spec/fixtures/.gitignore new file mode 100644 index 0000000..5aa5608 --- /dev/null +++ b/spec/fixtures/.gitignore @@ -0,0 +1,2 @@ +.tmp/ +modules/ diff --git a/spec/fixtures/Puppetfile b/spec/fixtures/Puppetfile index a649dda..62fb82e 100644 --- a/spec/fixtures/Puppetfile +++ b/spec/fixtures/Puppetfile @@ -1 +1,3 @@ -mod 'boxen', '3.0.2', :github_tarball => 'boxen/puppet-boxen' +mod 'boxen', '3.11.0', :github_tarball => 'boxen/puppet-boxen' +mod 'stdlib', '4.9.0', :github_tarball => 'puppetlabs/puppetlabs-stdlib' +mod 'wget', '1.0.1', :github_tarball => 'boxen/puppet-wget' diff --git a/spec/fixtures/hiera/common.yaml b/spec/fixtures/hiera/common.yaml new file mode 100644 index 0000000..dcd5825 --- /dev/null +++ b/spec/fixtures/hiera/common.yaml @@ -0,0 +1,10 @@ +--- +boxen::config::home: "%{::boxen_home}" +boxen::config::srcdir: "%{::boxen_srcdir}" +boxen::config::bindir: "%{::boxen_home}/bin" +boxen::config::cachedir: "%{::boxen_home}/cache" +boxen::config::configdir: "%{::boxen_home}/configdir" +boxen::config::datadir: "%{::boxen_home}/datadir" +boxen::config::envdir: "%{::boxen_home}/env.d" +boxen::config::logdir: "%{::boxen_home}/log" +boxen::config::socketdir: "%{::boxen_home}/data/project-sockets" diff --git a/spec/fixtures/hiera/hiera.yaml b/spec/fixtures/hiera/hiera.yaml new file mode 100644 index 0000000..7cbd533 --- /dev/null +++ b/spec/fixtures/hiera/hiera.yaml @@ -0,0 +1,7 @@ +--- +:backends: + - yaml +:hierarchy: + - common +:yaml: + :datadir: 'spec/fixtures/hiera' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d40a1c2..c7269d9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,7 @@ RSpec.configure do |c| c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') + c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' end def default_test_facts From 780b85e16ee162df4c835ce0d530797fb07fce77 Mon Sep 17 00:00:00 2001 From: n0ts Date: Sun, 22 May 2016 12:10:32 +0900 Subject: [PATCH 03/11] Update latest jdk and use provider appdmg_eula --- manifests/init.pp | 6 +++--- spec/classes/java_spec.rb | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e416ccf..16d1b17 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,8 +4,8 @@ # # include java class java ( - $update_version = '65', - $minor_version = 'b17' + $update_version = '92', + $minor_version = 'b14' ) { include boxen::config include wget @@ -28,7 +28,7 @@ } package { $jdk_package: - provider => 'pkgdmg', + provider => 'appdmg_eula', source => "${jdk_dir}/${jdk_package}", } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 797745f..2ccfa80 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -4,8 +4,8 @@ let(:facts) { default_test_facts } let(:params) { { - :update_version => '65', - :minor_version => 'b17', + :update_version => '92', + :minor_version => 'b14', } } @@ -18,16 +18,16 @@ :mode => '0755' }) - should contain_exec('download jdk-8u65-macosx-x64.dmg').with({ - :command => 'wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines', + should contain_exec("download jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ + :command => "wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u#{params[:update_version]}-#{params[:minor_version]}/jdk-8u#{params[:update_version]}-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines", :user => 'root', - :creates => '/Library/Java/JavaVirtualMachines/jdk-8u65-macosx-x64.dmg', + :creates => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", :require => 'Package[wget]', }) - should contain_package('jdk-8u65-macosx-x64.dmg').with({ - :provider => 'pkgdmg', - :source => '/Library/Java/JavaVirtualMachines/jdk-8u65-macosx-x64.dmg', + should contain_package("jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ + :provider => 'appdmg_eula', + :source => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", }) end end From f6d042adc539039ede170acdc0dc2f4dbb6d0d69 Mon Sep 17 00:00:00 2001 From: n0ts Date: Sun, 22 May 2016 21:56:13 +0900 Subject: [PATCH 04/11] Add package require --- manifests/init.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 16d1b17..267c75e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -24,11 +24,12 @@ 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'], + require => Package['wget'] } package { $jdk_package: provider => 'appdmg_eula', source => "${jdk_dir}/${jdk_package}", + require => Exec["download ${jdk_package}"] } } From e27e7ec2ea22b7936c03df3bfcb23208d9291c7c Mon Sep 17 00:00:00 2001 From: n0ts Date: Sun, 22 May 2016 23:28:59 +0900 Subject: [PATCH 05/11] Use pkgdmg --- manifests/init.pp | 2 +- spec/classes/java_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 267c75e..b8e5209 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,7 +28,7 @@ } package { $jdk_package: - provider => 'appdmg_eula', + provider => pkgdmg, source => "${jdk_dir}/${jdk_package}", require => Exec["download ${jdk_package}"] } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 2ccfa80..b66af32 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -26,7 +26,7 @@ }) should contain_package("jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ - :provider => 'appdmg_eula', + :provider => 'pkgdmg', :source => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", }) end From 3adb854342170f6398cb5d4257b6b977f24ab826 Mon Sep 17 00:00:00 2001 From: n0ts Date: Wed, 26 Oct 2016 16:03:26 +0900 Subject: [PATCH 06/11] Update JDK version --- README.md | 4 ++-- manifests/init.pp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 651909d..be9c925 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ All of these parameters have sensible defaults, and are provided if you need mor Example hiera data in YAML: ```yaml -java::update_version: '65' -java::minor_version: 'b17' +java::update_version: '111' +java::minor_version: 'b14' ``` ## Required Puppet Modules diff --git a/manifests/init.pp b/manifests/init.pp index b8e5209..613fa28 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,8 +4,8 @@ # # include java class java ( - $update_version = '92', - $minor_version = 'b14' + $update_version = '111', + $minor_version = 'b11' ) { include boxen::config include wget From 091e1ea1b011be511b8079a1b2c3e53e31f9718f Mon Sep 17 00:00:00 2001 From: n0ts Date: Fri, 21 Jul 2017 18:11:40 +0900 Subject: [PATCH 07/11] Upgrade JDK, support hash version... --- manifests/init.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 613fa28..7339762 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,14 +4,15 @@ # # include java class java ( - $update_version = '111', - $minor_version = 'b11' + $update_version = '141', + $minor_version = 'b15', + $hash_version = '336fa29ff2bb4ef291e347e091f7f4a7' ) { include boxen::config include wget $wrapper = "${boxen::config::bindir}/java" - $jdk_download_url = "http://download.oracle.com/otn-pub/java/jdk/8u${update_version}-${minor_version}" + $jdk_download_url = "http://download.oracle.com/otn-pub/java/jdk/8u${update_version}-${minor_version}/${hash_version}" $jdk_package = "jdk-8u${update_version}-macosx-x64.dmg" $jdk_dir = '/Library/Java/JavaVirtualMachines' From e5751a984dc94044bb05237d4f055d784a9f4032 Mon Sep 17 00:00:00 2001 From: n0ts Date: Wed, 21 Feb 2018 18:38:01 +0900 Subject: [PATCH 08/11] Update Gemfile --- Gemfile | 2 +- Gemfile.lock | 154 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 93 insertions(+), 63 deletions(-) diff --git a/Gemfile b/Gemfile index 5263ca0..6471ea7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem "cardboard", "~> 2.1.0" +gem "cardboard23", "~> 2.1" diff --git a/Gemfile.lock b/Gemfile.lock index 4685881..0bca1cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,82 +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 (3.1.3a) + ansi (~> 1.5) + hiera (~> 3.4.2) + highline (~> 1.7.8) + json_pure (>= 1.8.3, < 2.0) + octokit (~> 3.8, >= 3.8.0) + puppet (~> 4.10) + cardboard23 (2.1.1a) + boxen23 (~> 3.1) + librarian-puppet (~> 2.2) + puppet-lint (~> 2.3) + puppetlabs_spec_helper (~> 2.4) + rspec-puppet (~> 2.6) + diff-lcs (1.3) + facter (2.5.1) + facter (2.5.1-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.12.2) + faraday (>= 0.7.4, < 1.0) + fast_gettext (1.1.2) + gettext (3.2.6) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.30) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + hiera (3.4.2) + 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) + locale (2.1.2) metaclass (0.0.4) - mocha (1.1.0) + minitar (0.6.1) + mocha (1.3.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 + octokit (3.8.0) + sawyer (~> 0.6.0, >= 0.5.3) + puppet (4.10.10) + facter (> 2.0, < 4) + gettext-setup (>= 0.10, < 1) + hiera (>= 2.0, < 4) + json_pure (~> 1.8) + locale (~> 2.1) + puppet (4.10.10-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.3.3) + puppet-syntax (2.4.1) 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.2.9) + faraday (>= 0.9.0, < 0.14.0) + faraday_middleware (>= 0.9.0, < 0.13.0) + gettext-setup (~> 0.11) + minitar + semantic_puppet (~> 1.0) + puppetlabs_spec_helper (2.6.2) + mocha (~> 1.0) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + rake (12.3.0) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) 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.7.0) + rspec-puppet (2.6.9) rspec - rspec-support (3.1.2) - sawyer (0.5.5) + rspec-support (3.7.1) + 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.1) + gettext-setup (>= 0.3) + text (1.3.1) + thor (0.20.0) PLATFORMS ruby + universal-darwin-17 DEPENDENCIES - cardboard (~> 2.1.0) + cardboard23 (~> 2.1) BUNDLED WITH - 1.10.6 + 1.16.1 From 6d563fd792469f30f6edb0672d72b62e900775ea Mon Sep 17 00:00:00 2001 From: n0ts Date: Thu, 22 Feb 2018 10:36:02 +0900 Subject: [PATCH 09/11] Support ruby 2.3 --- .travis.yml | 1 + README.md | 13 +++++++------ manifests/init.pp | 18 ++++++++++-------- spec/classes/java_spec.rb | 7 +++++-- spec/fixtures/Puppetfile | 5 ++--- spec/fixtures/hiera/common.yaml | 10 ---------- spec/fixtures/hiera/hiera.yaml | 7 ------- spec/spec_helper.rb | 8 +++++--- 8 files changed, 30 insertions(+), 39 deletions(-) delete mode 100644 spec/fixtures/hiera/common.yaml delete mode 100644 spec/fixtures/hiera/hiera.yaml diff --git a/.travis.yml b/.travis.yml index c365f95..469aba4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,4 @@ script: "./script/cibuild" gemfile: "this/does/not/exist" rvm: - "2.0.0" + - "2.3.3" diff --git a/README.md b/README.md index be9c925..d866a5a 100644 --- a/README.md +++ b/README.md @@ -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 8. +Installs Oracle Java 8. ## Usage @@ -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 JDK version to install. For example, if you specify `65`, the module would install java 8u65 -* `minor_version`: The 'minor' part of the JDK download URL. For example download URL is http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-macosx-x64.dmg, minor verson is 'b17'. +* `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: '111' -java::minor_version: 'b14' +java::update_version: '152' +java::minor_version: 'b16' +java::hash_version: 'aa0333dd3019491ca4f6ddbe78cdb6d0' ``` ## Required Puppet Modules diff --git a/manifests/init.pp b/manifests/init.pp index 7339762..3dc49b1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,13 +3,13 @@ # Examples # # include java + class java ( - $update_version = '141', - $minor_version = 'b15', - $hash_version = '336fa29ff2bb4ef291e347e091f7f4a7' + $update_version = '161', + $minor_version = 'b12', + $hash_version = '2f38c3b165be4555a1fa6e98c45e0808' ) { include boxen::config - include wget $wrapper = "${boxen::config::bindir}/java" $jdk_download_url = "http://download.oracle.com/otn-pub/java/jdk/8u${update_version}-${minor_version}/${hash_version}" @@ -17,20 +17,22 @@ $jdk_dir = '/Library/Java/JavaVirtualMachines' file { $wrapper: - source => 'puppet:///modules/java/java.sh', - mode => '0755' + source => 'puppet:///modules/java/java.sh', + mode => '0755', } + package { 'wget': } + 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'] + require => Package['wget'], } package { $jdk_package: provider => pkgdmg, source => "${jdk_dir}/${jdk_package}", - require => Exec["download ${jdk_package}"] + require => Exec["download ${jdk_package}"], } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index b66af32..3d99dc1 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -6,20 +6,23 @@ { :update_version => '92', :minor_version => 'b14', + :hash_version => '1234', } } it do should contain_class('boxen::config') - should contain_class('wget') should contain_file('/test/boxen/bin/java').with({ :source => 'puppet:///modules/java/java.sh', :mode => '0755' }) + +#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}", should contain_exec("download jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ - :command => "wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u#{params[:update_version]}-#{params[:minor_version]}/jdk-8u#{params[:update_version]}-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines", + :command => "wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u#{params[:update_version]}-#{params[:minor_version]}/#{params[:hash_version]}/jdk-8u#{params[:update_version]}-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines", :user => 'root', :creates => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", :require => 'Package[wget]', diff --git a/spec/fixtures/Puppetfile b/spec/fixtures/Puppetfile index 62fb82e..284f6e4 100644 --- a/spec/fixtures/Puppetfile +++ b/spec/fixtures/Puppetfile @@ -1,3 +1,2 @@ -mod 'boxen', '3.11.0', :github_tarball => 'boxen/puppet-boxen' -mod 'stdlib', '4.9.0', :github_tarball => 'puppetlabs/puppetlabs-stdlib' -mod 'wget', '1.0.1', :github_tarball => 'boxen/puppet-wget' +mod 'boxen', '3.13.0c', :github_tarball => 'n0ts/puppet-boxen' +mod 'stdlib', '4.17.1', :github_tarball => 'puppetlabs/puppetlabs-stdlib' diff --git a/spec/fixtures/hiera/common.yaml b/spec/fixtures/hiera/common.yaml deleted file mode 100644 index dcd5825..0000000 --- a/spec/fixtures/hiera/common.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -boxen::config::home: "%{::boxen_home}" -boxen::config::srcdir: "%{::boxen_srcdir}" -boxen::config::bindir: "%{::boxen_home}/bin" -boxen::config::cachedir: "%{::boxen_home}/cache" -boxen::config::configdir: "%{::boxen_home}/configdir" -boxen::config::datadir: "%{::boxen_home}/datadir" -boxen::config::envdir: "%{::boxen_home}/env.d" -boxen::config::logdir: "%{::boxen_home}/log" -boxen::config::socketdir: "%{::boxen_home}/data/project-sockets" diff --git a/spec/fixtures/hiera/hiera.yaml b/spec/fixtures/hiera/hiera.yaml deleted file mode 100644 index 7cbd533..0000000 --- a/spec/fixtures/hiera/hiera.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -:backends: - - yaml -:hierarchy: - - common -:yaml: - :datadir: 'spec/fixtures/hiera' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c7269d9..09c50ae 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,12 +5,14 @@ RSpec.configure do |c| c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') - c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' end def default_test_facts { - :boxen_home => "/test/boxen", - :boxen_user => "testuser" + :boxen_home => '/test/boxen', + :boxen_user => 'testuser', + :boxen_repodir => File.join(File.dirname(__FILE__), 'fixtures'), + :boxen_repo_url_template => "https://github.com/%s", + :boxen_srcdir => '~/src', } end From 483a02225d91eb6290c29663ca0f45b5aad10abd Mon Sep 17 00:00:00 2001 From: n0ts Date: Tue, 26 May 2020 18:55:52 +0900 Subject: [PATCH 10/11] Fix CI --- .travis.yml | 3 +- Gemfile | 2 +- Gemfile.lock | 88 +++++++++++++++++++++---------------------- script/cardboard-exec | 6 ++- 4 files changed, 51 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index 469aba4..a7fdd7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ --- script: "./script/cibuild" -gemfile: "this/does/not/exist" +gemfile: "Gemfile" rvm: - - "2.0.0" - "2.3.3" diff --git a/Gemfile b/Gemfile index 6471ea7..c360ac2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem "cardboard23", "~> 2.1" +gem "cardboard23", "~> 3.0.0b" diff --git a/Gemfile.lock b/Gemfile.lock index 0bca1cd..37ea2fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,36 +4,37 @@ GEM CFPropertyList (2.2.8) addressable (2.3.8) ansi (1.5.0) - boxen23 (3.1.3a) + boxen23 (4.0.0a) ansi (~> 1.5) - hiera (~> 3.4.2) - highline (~> 1.7.8) + hiera (~> 3.4) + highline (~> 1.7) json_pure (>= 1.8.3, < 2.0) octokit (~> 3.8, >= 3.8.0) puppet (~> 4.10) - cardboard23 (2.1.1a) - boxen23 (~> 3.1) + 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.1) - facter (2.5.1-universal-darwin) + facter (2.5.7) + facter (2.5.7-universal-darwin) CFPropertyList (~> 2.2) faraday (0.9.2) multipart-post (>= 1.2, < 3) - faraday_middleware (0.12.2) + faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) fast_gettext (1.1.2) - gettext (3.2.6) + gettext (3.2.9) locale (>= 2.0.5) text (>= 1.3.0) - gettext-setup (0.30) + gettext-setup (0.34) fast_gettext (~> 1.1.0) - gettext (>= 3.0.2) + gettext (>= 3.0.2, < 3.3.0) locale - hiera (3.4.2) + hiera (3.6.0) highline (1.7.10) json_pure (1.8.6) librarian-puppet (2.2.3) @@ -42,72 +43,71 @@ GEM rsync librarianp (0.6.4) thor (~> 0.15) - locale (2.1.2) - metaclass (0.0.4) - minitar (0.6.1) - mocha (1.3.0) - metaclass (~> 0.0.1) - multipart-post (2.0.0) + 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) - puppet (4.10.10) + 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.10-universal-darwin) + 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.3.3) - puppet-syntax (2.4.1) + puppet-lint (2.4.2) + puppet-syntax (2.6.0) rake - puppet_forge (2.2.9) - faraday (>= 0.9.0, < 0.14.0) - faraday_middleware (>= 0.9.0, < 0.13.0) + 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.6.2) + 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 (12.3.0) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.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.7.0) - rspec-mocks (3.7.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-puppet (2.6.9) + rspec-support (~> 3.9.0) + rspec-puppet (2.7.8) rspec - rspec-support (3.7.1) + rspec-support (3.9.3) rsync (1.0.9) sawyer (0.6.0) addressable (~> 2.3.5) faraday (~> 0.8, < 0.10) - semantic_puppet (1.0.1) - gettext-setup (>= 0.3) + semantic_puppet (1.0.2) text (1.3.1) - thor (0.20.0) + thor (0.20.3) PLATFORMS ruby universal-darwin-17 DEPENDENCIES - cardboard23 (~> 2.1) + cardboard23 (~> 3.0.0b) BUNDLED WITH - 1.16.1 + 2.1.4 diff --git a/script/cardboard-exec b/script/cardboard-exec index 664c5d2..ba36ab1 100755 --- a/script/cardboard-exec +++ b/script/cardboard-exec @@ -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 From 791667528125062c80ff1f5f2bf8f47c8858c983 Mon Sep 17 00:00:00 2001 From: n0ts Date: Fri, 29 May 2020 22:53:11 +0900 Subject: [PATCH 11/11] Support latest JDK version --- manifests/init.pp | 12 +++++------- spec/classes/java_spec.rb | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3dc49b1..6d72b8b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,15 +5,15 @@ # include java class java ( - $update_version = '161', - $minor_version = 'b12', - $hash_version = '2f38c3b165be4555a1fa6e98c45e0808' + $major_version = '14.0.1', + $minor_version = '7', + $hash_version = '664493ef4a6946b186ff29eb326336a2' ) { include boxen::config $wrapper = "${boxen::config::bindir}/java" - $jdk_download_url = "http://download.oracle.com/otn-pub/java/jdk/8u${update_version}-${minor_version}/${hash_version}" - $jdk_package = "jdk-8u${update_version}-macosx-x64.dmg" + $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: @@ -21,8 +21,6 @@ mode => '0755', } - package { 'wget': } - 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, diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 3d99dc1..122afa0 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -4,9 +4,9 @@ let(:facts) { default_test_facts } let(:params) { { - :update_version => '92', - :minor_version => 'b14', - :hash_version => '1234', + :major_version => '14.0.1', + :minor_version => '7', + :hash_version => '664493ef4a6946b186ff29eb326336a2' } } @@ -14,23 +14,21 @@ should contain_class('boxen::config') should contain_file('/test/boxen/bin/java').with({ - :source => 'puppet:///modules/java/java.sh', - :mode => '0755' + :source => 'puppet:///modules/java/java.sh', + :mode => '0755' }) - -#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}", - should contain_exec("download jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ - :command => "wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' http://download.oracle.com/otn-pub/java/jdk/8u#{params[:update_version]}-#{params[:minor_version]}/#{params[:hash_version]}/jdk-8u#{params[:update_version]}-macosx-x64.dmg -P /Library/Java/JavaVirtualMachines", + should contain_exec("download jdk-#{params[:major_version]}_osx-x64_bin.dmg").with({ + :command => "wget --quiet --no-check-certificate --no-cookies --header \'Cookie: oraclelicense=accept-securebackup-cookie\' https://download.oracle.com/otn-pub/java/jdk/#{params[:major_version]}+#{params[:minor_version]}/#{params[:hash_version]}/jdk-#{params[:major_version]}_osx-x64_bin.dmg -P /Library/Java/JavaVirtualMachines", :user => 'root', - :creates => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", + :creates => "/Library/Java/JavaVirtualMachines/jdk-#{params[:major_version]}_osx-x64_bin.dmg", :require => 'Package[wget]', }) - should contain_package("jdk-8u#{params[:update_version]}-macosx-x64.dmg").with({ + should contain_package("jdk-#{params[:major_version]}_osx-x64_bin.dmg").with({ :provider => 'pkgdmg', - :source => "/Library/Java/JavaVirtualMachines/jdk-8u#{params[:update_version]}-macosx-x64.dmg", + :source => "/Library/Java/JavaVirtualMachines/jdk-#{params[:major_version]}_osx-x64_bin.dmg", + :require => "Exec[download jdk-#{params[:major_version]}_osx-x64_bin.dmg]", }) end end