Skip to content

Commit

Permalink
Use a unique file resource title for lib/ext directory in install_jar…
Browse files Browse the repository at this point in the history
…s defined type. Fixes Issue #55
  • Loading branch information
fatmcgav committed Dec 4, 2015
1 parent 0d70852 commit 2c70677
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions manifests/install_jars.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@

# Create the lib/ext folder if required
if ($install_location == 'installation') {
file { "${glassfish::glassfish_dir}/glassfish/lib/ext":
file { "${jar}_lib_ext":
ensure => directory,
path => "${glassfish::glassfish_dir}/glassfish/lib/ext",
owner => $glassfish::user,
group => $glassfish::group
}

if ($download) {
File["${glassfish::glassfish_dir}/glassfish/lib/ext"] -> Exec["download_${jar}"]
File["${jar}_lib_ext"] -> Exec["download_${jar}"]
} else {
File["${glassfish::glassfish_dir}/glassfish/lib/ext"] -> File[$jardest]
File["${jar}_lib_ext"] -> File[$jardest]
}
}

Expand Down
6 changes: 4 additions & 2 deletions spec/defines/install_jars_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
let(:params) { default_params }

it { should contain_glassfish__install_jars('test.jar') }
it { should contain_file('/usr/local/glassfish-3.1.2.2/glassfish/lib/ext').with({
it { should contain_file('test.jar_lib_ext').with({
'ensure' => 'directory',
'path' => '/usr/local/glassfish-3.1.2.2/glassfish/lib/ext',
'owner' => 'glassfish',
'group' => 'glassfish'
}).that_comes_before('File[/usr/local/glassfish-3.1.2.2/glassfish/lib/ext/test.jar]') }
Expand Down Expand Up @@ -101,8 +102,9 @@
end

it { should contain_glassfish__install_jars('http://www.test.com/test.jar') }
it { should contain_file('/usr/local/glassfish-3.1.2.2/glassfish/lib/ext').with({
it { should contain_file('test.jar_lib_ext').with({
'ensure' => 'directory',
'path' => '/usr/local/glassfish-3.1.2.2/glassfish/lib/ext',
'owner' => 'glassfish',
'group' => 'glassfish'
}).that_comes_before('Exec[download_test.jar]') }
Expand Down

0 comments on commit 2c70677

Please sign in to comment.