diff --git a/README.md b/README.md index fd3692f..d24e02c 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` 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. 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 + +