summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-09-08 03:37:11 -0400
committerJames Shubin <james@shubin.ca>2013-09-08 03:37:11 -0400
commit5e51cc3f32557eb10e8c9771d3fb2d633b6bc031 (patch)
tree8147d6baab2d179f2e03a88e971aa690d676e544 /manifests
parent2b0f3e405917dce758a5ebd5e11093b97428666f (diff)
downloadpuppet-gluster-5e51cc3f32557eb10e8c9771d3fb2d633b6bc031.tar.gz
puppet-gluster-5e51cc3f32557eb10e8c9771d3fb2d633b6bc031.tar.xz
puppet-gluster-5e51cc3f32557eb10e8c9771d3fb2d633b6bc031.zip
Better slash handling
Diffstat (limited to 'manifests')
-rw-r--r--manifests/brick.pp10
1 files changed, 6 insertions, 4 deletions
diff --git a/manifests/brick.pp b/manifests/brick.pp
index c150fc1..889b752 100644
--- a/manifests/brick.pp
+++ b/manifests/brick.pp
@@ -35,6 +35,8 @@ define gluster::brick(
#$path = $split[1] # brick mount or storage path
# TODO: create substring function
$path = inline_template("<%= '${name}'.slice('${host}'.length+1, '${name}'.length-'${host}'.length-1) %>")
+ $short_path = sprintf("%s", regsubst($path, '\/$', '')) # no trailing
+ $valid_path = sprintf("%s/", regsubst($path, '\/$', ''))
if ! ( "${host}:${path}" == "${name}" ) {
fail('The brick $name must match a $host-$path pattern.')
@@ -167,7 +169,7 @@ define gluster::brick(
}
# make an empty directory for the mount point
- file { "${path}":
+ file { "${valid_path}":
ensure => directory, # make sure this is a directory
recurse => false, # don't recurse into directory
purge => false, # don't purge unmanaged files
@@ -175,7 +177,8 @@ define gluster::brick(
require => Exec["gluster-brick-make-${name}"],
}
- mount { "${path}":
+ # mount points don't seem to like trailing slashes...
+ mount { "${short_path}":
atboot => true,
ensure => mounted,
device => "UUID=${fsuuid}",
@@ -189,13 +192,12 @@ define gluster::brick(
# xfs uses xfs_check and friends only when suspect.
pass => '2', # fs_passno: 0 to skip fsck on boot
require => [
- File["${path}"],
+ File["${valid_path}"],
],
}
} elsif ((type($dev) == 'boolean') and (! $dev)) and ("${fqdn}" == "${host}") {
- $valid_path = sprintf("%s/", regsubst($path, '\/$', ''))
# ensure the full path exists!
exec { "/bin/mkdir -p '${valid_path}'":
creates => "${valid_path}",