summaryrefslogtreecommitdiffstats
path: root/manifests/volume.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-09-19 12:36:02 -0400
committerJames Shubin <james@shubin.ca>2013-09-19 12:36:02 -0400
commit17aff1a33a001cbb56735ff9f61a9bbcaa40cb04 (patch)
tree0fdec8d63d093521ce57218dbef15d0c2fe995a3 /manifests/volume.pp
parentfa3fd2eb4bab499031274e0918a40e7a99fe0086 (diff)
downloadpuppet-gluster-17aff1a33a001cbb56735ff9f61a9bbcaa40cb04.tar.gz
puppet-gluster-17aff1a33a001cbb56735ff9f61a9bbcaa40cb04.tar.xz
puppet-gluster-17aff1a33a001cbb56735ff9f61a9bbcaa40cb04.zip
Give glusterd a chance to settle down before we create a volume.
This is usually only relevant right after initial peering if we're doing a hot (clean) puppet build. This probably happens because puppet is eager to run things as soon as possible, and after glusterd is restarted, it takes a short moment for glusterd to see the other nodes as fully peered. Ideally puppet should really only check the $onlyif conditions *right* before it runs the command. I think that it might be cheating here and running it in parallel slightly before... Who knows.
Diffstat (limited to 'manifests/volume.pp')
-rw-r--r--manifests/volume.pp4
1 files changed, 3 insertions, 1 deletions
diff --git a/manifests/volume.pp b/manifests/volume.pp
index 60feb83..3d00dca 100644
--- a/manifests/volume.pp
+++ b/manifests/volume.pp
@@ -116,8 +116,10 @@ define gluster::volume(
if ($vip == '' or $vipif != '') {
# store command in a separate file to run as bash...
+ # NOTE: we sleep for 5 seconds to give glusterd a chance to
+ # settle down first if we're doing a hot (clean) puppet run
file { "${vardir}/volume/create-${name}.sh":
- content => inline_template("#!/bin/bash\n/usr/sbin/gluster volume create ${name} ${valid_replica}${valid_stripe}transport ${valid_transport} ${brick_spec} > >(/usr/bin/tee '/tmp/gluster-volume-${name}.stdout') 2> >(/usr/bin/tee '/tmp/gluster-volume-${name}.stderr' >&2) || (${rmdir_volume_dirs} && /bin/false)\nexit \$?\n"),
+ content => inline_template("#!/bin/bash\n/bin/sleep 5s && /usr/sbin/gluster volume create ${name} ${valid_replica}${valid_stripe}transport ${valid_transport} ${brick_spec} > >(/usr/bin/tee '/tmp/gluster-volume-${name}.stdout') 2> >(/usr/bin/tee '/tmp/gluster-volume-${name}.stderr' >&2) || (${rmdir_volume_dirs} && /bin/false)\nexit \$?\n"),
owner => root,
group => root,
mode => 755,