Skip to content

Commit

Permalink
Fix nfsv4_bindmount when nfs_v4_export_root includes a trailing slash (
Browse files Browse the repository at this point in the history
…#165)

If $nfs::server::nfs_v4_export_root ends with a trailing slash, or
is simply equal to '/', Puppet thinks the bindmounts are not mounted
and try to mount them at each apply.
  • Loading branch information
cmd-ntrf authored Mar 2, 2023
1 parent a5b25bf commit aff532b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifests/functions/nfsv4_bindmount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
$bind,
$ensure = 'mounted',
) {
$expdir = "${nfs::server::nfs_v4_export_root}/${v4_export_name}"
$normalize_export_root = regsubst($nfs::server::nfs_v4_export_root, '/$', '')
$expdir = "${normalize_export_root}/${v4_export_name}"
nfs::functions::mkdir { $expdir:
ensure => $ensure,
}
Expand Down

0 comments on commit aff532b

Please sign in to comment.