Skip to content

Commit 9131c9c

Browse files
authored
Merge pull request voxpupuli#190 from jcpunk/claim-ownership
Add ownership of cachedir to puppet if claiming ownership
2 parents 0ddce5f + 47d6147 commit 9131c9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

manifests/install.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
String[1] $cvmfs_version = $cvmfs::cvmfs_version,
66
Stdlib::Absolutepath $cvmfs_cache_base = $cvmfs::cvmfs_cache_base,
77
Optional[Boolean] $fuse3 = $cvmfs::fuse3,
8+
Optional[Enum['yes','no']] $cvmfs_claim_ownership = $cvmfs::cvmfs_claim_ownership,
89
) inherits cvmfs {
910
# Create the cache dir if one is defined, otherwise assume default is in the package.
1011
# Require the package so we know the user is in place.
@@ -14,7 +15,7 @@
1415
# Compare the default value with the one from hiera if declared
1516
$default_cvmfs_cache_base = '/var/lib/cvmfs'
1617

17-
if $cvmfs_cache_base != $default_cvmfs_cache_base {
18+
if ($cvmfs_claim_ownership == 'yes') or ($cvmfs_cache_base != $default_cvmfs_cache_base) {
1819
file { $cvmfs_cache_base:
1920
ensure => directory,
2021
owner => $cvmfs::cvmfs_cache_owner,

spec/classes/init_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@
531531
it do
532532
is_expected.to contain_concat__fragment('cvmfs_default_local_header').
533533
without_content(%r{^CVMFS_CLAIM_OWNERSHIP})
534+
is_expected.not_to contain_file('/var/lib/cvmfs')
534535
end
535536
end
536537

@@ -543,6 +544,7 @@
543544
it do
544545
is_expected.to contain_concat__fragment('cvmfs_default_local_header').
545546
with_content(%r{^CVMFS_CLAIM_OWNERSHIP='yes'$})
547+
is_expected.to contain_file('/var/lib/cvmfs').with_owner('cvmfs').with_group('cvmfs')
546548
end
547549
end
548550

0 commit comments

Comments
 (0)