summaryrefslogtreecommitdiffstats
path: root/manifests/volume/property
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2014-03-12 11:34:52 -0400
committerJames Shubin <james@shubin.ca>2014-03-16 22:39:08 -0400
commit05576cd410bb2616ce72e3e9e24850f911cbb6dc (patch)
tree0286fce76ac26f8aa74caf96c04cc70f180f6101 /manifests/volume/property
parentfbe9e9cb4bd8cc4278eba8e16bc69f009f334d7a (diff)
downloadpuppet-gluster-05576cd410bb2616ce72e3e9e24850f911cbb6dc.tar.gz
puppet-gluster-05576cd410bb2616ce72e3e9e24850f911cbb6dc.tar.xz
puppet-gluster-05576cd410bb2616ce72e3e9e24850f911cbb6dc.zip
Setting volume properties should be race-free.
This isn't essential, as ensuring this is race-free is really up to glusterfs, but with this patch you reduce the likelihood to ~0% that you'll see a: "volume set: failed: Another transaction is in progress." error. The error isn't harmful, but now we'll see less unnecessary red.
Diffstat (limited to 'manifests/volume/property')
-rw-r--r--manifests/volume/property/group.pp5
1 files changed, 4 insertions, 1 deletions
diff --git a/manifests/volume/property/group.pp b/manifests/volume/property/group.pp
index 02b5fcb..d0b7a60 100644
--- a/manifests/volume/property/group.pp
+++ b/manifests/volume/property/group.pp
@@ -23,6 +23,7 @@
# NOTE: this does the equivalent of: gluster volume set <VOLNAME> group <GROUP>
define gluster::volume::property::group(
+ $vip = '', # vip of the cluster (optional but recommended)
) {
include gluster::xml
include gluster::vardir
@@ -62,8 +63,10 @@ define gluster::volume::property::group(
$group_data_yaml = inline_template("<%= @group_data_list.inject(Hash.new) { |h,i| { '${volume}#'+((i.split('=').length == 2) ? i.split('=')[0] : '') => {'value' => ((i.split('=').length == 2) ? i.split('=')[1] : '')} }.merge(h) }.to_yaml %>")
# build into a hash
$group_data_hash = parseyaml($group_data_yaml)
+ # pass through the vip
+ $group_data_defaults = {'vip' => "${vip}"}
# create the properties
- create_resources('gluster::volume::property', $group_data_hash)
+ create_resources('gluster::volume::property', $group_data_hash, $group_data_defaults)
}
}