From 0f04e1c19695e31fed5b0dc68d5230da6a9db167 Mon Sep 17 00:00:00 2001 From: shikhar+jacks Date: Tue, 24 Jun 2014 10:40:30 -0700 Subject: [PATCH 1/3] added wrap_java parameter to java class. it will not create the custom java.sh if set to false --- manifests/init.pp | 13 ++++++++----- spec/classes/java_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1678816..7ba8af1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 { + file { $wrapper: + source => 'puppet:///modules/java/java.sh', + mode => '0755', + require => Package['java'] + } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 454cb91..d430bef 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -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 + + From e90461400b1459603c3f185a3ccb034a2d6b590f Mon Sep 17 00:00:00 2001 From: shikhar+jacks Date: Tue, 24 Jun 2014 10:45:12 -0700 Subject: [PATCH 2/3] added description for wrap_java parameter to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd3692f..86c2c37 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ You can customise this module by configuring some optional class parameters. Usu * `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`. +* `wrap_java`: Whether to add a java.sh file in boxen::config::bindir that modifies DYLD_FALLBACK_LIBRARY_PATH and JAVA_HOME All of these parameters have sensible defaults, and are provided if you need more control. From 4a1ed3281e16b7d3c11eadd554988a6683bc0fa5 Mon Sep 17 00:00:00 2001 From: shikhar+jacks Date: Tue, 24 Jun 2014 10:46:21 -0700 Subject: [PATCH 3/3] clarified readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86c2c37..d24e02c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can customise this module by configuring some optional class parameters. Usu * `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`. -* `wrap_java`: Whether to add a java.sh file in boxen::config::bindir that modifies DYLD_FALLBACK_LIBRARY_PATH and JAVA_HOME +* `wrap_java`: Whether to add a `java` script in boxen::config::bindir that modifies DYLD_FALLBACK_LIBRARY_PATH and JAVA_HOME All of these parameters have sensible defaults, and are provided if you need more control.