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

Adding a wrap_java parameter to allow disabling use of the java.sh script #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
added wrap_java parameter to java class. it will not create the custo…
…m java.sh if set to false
shikhar+jacks committed Jun 24, 2014
commit 0f04e1c19695e31fed5b0dc68d5230da6a9db167
13 changes: 8 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@
# include java
class java (
$update_version = '55',
$base_download_url = 'https://s3.amazonaws.com/boxen-downloads/java'
$base_download_url = 'https://s3.amazonaws.com/boxen-downloads/java',
$wrap_java = true,
) {
include boxen::config

@@ -28,10 +29,12 @@
source => $jdk_url ;
}

file { $wrapper:
source => 'puppet:///modules/java/java.sh',
mode => '0755',
require => Package['java']
if $wrap_java {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a conditional, it's probably better to use the ensure parameter of the file resource. That way, if wrap_java = false, then the wrapper will get removed if it were there before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loyal3-green-team If you can do this then we'll merge it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and rebase it)

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


21 changes: 21 additions & 0 deletions spec/classes/java_spec.rb
Original file line number Diff line number Diff line change
@@ -32,4 +32,25 @@
:require => 'Package[java]'
})
end


end

describe "java" do
let(:facts) { default_test_facts }
let(:params) {
{
:wrap_java => false
}
}

it do
should_not contain_file('/test/boxen/bin/java').with({
:source => 'puppet:///modules/java/java.sh',
:mode => '0755',
:require => 'Package[java]'
})
end
end