summaryrefslogtreecommitdiffstats
path: root/manifests/brick.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2014-06-06 14:40:26 -0400
committerJames Shubin <james@shubin.ca>2015-03-10 00:51:47 -0400
commit3dec43724737996dd8ee12cd5f567f3234510b37 (patch)
tree52cbe485d3fd8df2661e4cef95f0dc1127ef47db /manifests/brick.pp
parent981ff7ed49a5a5a7809216a14e2a4bacb222bce3 (diff)
downloadpuppet-gluster-master.tar.gz
puppet-gluster-master.tar.xz
puppet-gluster-master.zip
This unifies the single brick case with the multi brick case.HEADmaster
This avoids errors if you have only one brick vs. many. A small note: I haven't tested this ad-infinitum, but since nobody who has tested it privately has complained, I'm sticking this in git master so that it gets wider testing. If anyone has issues, please report!
Diffstat (limited to 'manifests/brick.pp')
-rw-r--r--manifests/brick.pp13
1 files changed, 12 insertions, 1 deletions
diff --git a/manifests/brick.pp b/manifests/brick.pp
index 4ebdcb1..ee308f2 100644
--- a/manifests/brick.pp
+++ b/manifests/brick.pp
@@ -524,11 +524,22 @@ define gluster::brick(
} elsif ((type($dev) == 'boolean') and (! $dev)) and ("${fqdn}" == "${host}") {
# ensure the full path exists!
+ # TODO: is the mkdir needed ?
exec { "/bin/mkdir -p '${valid_path}'":
creates => "${valid_path}",
logoutput => on_failure,
noop => $exec_noop,
- alias => "gluster-brick-mkdir ${name}",
+ alias => "gluster-brick-mkdir-${name}",
+ before => File["${valid_path}"],
+ }
+
+ # avoid any possible purging of data!
+ 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
+ force => false, # don't purge subdirs and links
+ require => Exec["gluster-brick-mkfs-${name}"],
}
}
}