diff options
author | James Shubin <james@shubin.ca> | 2014-06-06 14:40:26 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2015-03-10 00:51:47 -0400 |
commit | 3dec43724737996dd8ee12cd5f567f3234510b37 (patch) | |
tree | 52cbe485d3fd8df2661e4cef95f0dc1127ef47db | |
parent | 981ff7ed49a5a5a7809216a14e2a4bacb222bce3 (diff) | |
download | puppet-gluster-master.tar.gz puppet-gluster-master.tar.xz puppet-gluster-master.zip |
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!
-rw-r--r-- | manifests/brick.pp | 13 | ||||
-rw-r--r-- | manifests/simple.pp | 19 |
2 files changed, 22 insertions, 10 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}"], } } } diff --git a/manifests/simple.pp b/manifests/simple.pp index 1b72df3..45d3bd1 100644 --- a/manifests/simple.pp +++ b/manifests/simple.pp @@ -43,15 +43,16 @@ class gluster::simple( #$vardir = $::gluster::vardir::module_vardir # with trailing slash $vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '') - if "${path}" == '' { - file { "${vardir}/data/": - 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 => File["${vardir}/"], - } - } + # NOTE: this is done in brick.pp now + #if "${path}" == '' { + # file { "${vardir}/data/": + # 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 => File["${vardir}/"], + # } + #} $chosen_path = "${path}" ? { '' => "${vardir}/data/", |