diff options
Diffstat (limited to 'manifests/volume.pp')
-rw-r--r-- | manifests/volume.pp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/manifests/volume.pp b/manifests/volume.pp index 218e8ed..ff6a824 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -27,10 +27,13 @@ define gluster::volume( $vip = '', # vip of the cluster (optional but recommended) $ping = true, # do we want to include fping checks ? $settle = true, # do we want to run settle checks ? + $again = true, # do we want to use Exec['again'] ? $start = undef # start volume ? true, false (stop it) or undef ) { include gluster::xml - include gluster::again + if $again { + include gluster::again + } include gluster::vardir include gluster::volume::base if $ping { @@ -230,7 +233,10 @@ define gluster::volume( logoutput => on_failure, unless => "/usr/sbin/gluster volume list | /bin/grep -qxF '${name}' -", # reconnect if it doesn't exist onlyif => sprintf("/usr/sbin/gluster peer status --xml | ${vardir}/xml.py stuck %s", $others), - notify => Common::Again::Delta['gluster-exec-again'], + notify => $again ? { + false => undef, + default => Common::Again::Delta['gluster-exec-again'], + }, require => [ Service['glusterd'], File["${vardir}/xml.py"], # stuck check @@ -254,7 +260,10 @@ define gluster::volume( # this notify is the first to kick off the 2nd step! it # was put here after a process of elimination, and this # location makes a lot of sense: on change exec[again]! - notify => Common::Again::Delta['gluster-exec-again'], + notify => $again ? { + false => undef, + default => Common::Again::Delta['gluster-exec-again'], + }, require => File["${vardir}/volume/"], } @@ -295,7 +304,10 @@ define gluster::volume( unless => "/usr/sbin/gluster volume status ${name}", # returns false if stopped notify => $shorewall ? { false => undef, - default => Common::Again::Delta['gluster-exec-again'], + default => $again ? { + false => undef, + default => Common::Again::Delta['gluster-exec-again'], + }, }, require => $settled ? { # require if type exists false => undef, @@ -411,7 +423,10 @@ define gluster::volume( # difference to record, or the sequence hasn't settled # we also check that we have our minimum settle count! onlyif => "/usr/bin/test ! -e '${watchfile}' || ${diff} || /usr/bin/test '1' != '${one}' || /usr/bin/test ${watch_trim_size} -lt ${settle_count}", - notify => Common::Again::Delta['gluster-exec-again'], + notify => $again ? { + false => undef, + default => Common::Again::Delta['gluster-exec-again'], + }, require => [ File["${vardir}/volume/fsm/${name}/"], # easy way to ensure the transition types don't need to |