diff options
author | James Shubin <james@shubin.ca> | 2014-03-11 12:14:52 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2014-03-16 22:39:07 -0400 |
commit | 170780287dd99191d1ea908c78ce88489366c0e0 (patch) | |
tree | 6be1a0d31c0b0a638960d6095a3f18f6b976ce1f /manifests/volume.pp | |
parent | 1152b69c58e3f4a6bb959ee1521a1ab68daa5599 (diff) | |
download | puppet-gluster-170780287dd99191d1ea908c78ce88489366c0e0.tar.gz puppet-gluster-170780287dd99191d1ea908c78ce88489366c0e0.tar.xz puppet-gluster-170780287dd99191d1ea908c78ce88489366c0e0.zip |
Add per volume support for brick chaining.
* Don't use this feature unless you _really_ know what you're doing.
* Managing chained volumes is much harder than managing normal ones.
* If some of the volumes in the cluster use this, and others don't, then
you'll probably have an even crazier time with management.
* Please verify my algorithm and feel free to suggest changes.
* Some edge cases haven't been tested.
* This patch breaks out brick layout ordering into individual functions.
Diffstat (limited to 'manifests/volume.pp')
-rw-r--r-- | manifests/volume.pp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/manifests/volume.pp b/manifests/volume.pp index 645c090..c6e285d 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -21,6 +21,9 @@ define gluster::volume( $transport = 'tcp', $replica = 1, $stripe = 1, + # TODO: maybe this should be called 'chained' => true/false, and maybe, + # we can also specify an offset count for chaining, or other parameters + $layout = '', # brick layout to use (default, chained, etc...) $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 ? @@ -76,9 +79,15 @@ define gluster::volume( $gluster_brick_group_fact = getvar("gluster_brick_group_${group}") $collected_bricks = split($gluster_brick_group_fact, ',') + # run the appropriate layout function here + $ordered_brick_layout = $layout ? { + 'chained' => brick_layout_chained($replica, $collected_bricks), + default => brick_layout_simple($replica, $collected_bricks), + } + $valid_bricks = type($bricks) ? { 'boolean' => $bricks ? { - true => $collected_bricks, # an array... + true => $ordered_brick_layout, # an array... default => [], # invalid type }, 'list' => $bricks, @@ -86,6 +95,7 @@ define gluster::volume( } # helpful debugging! + notice(inline_template('collected_bricks: <%= @collected_bricks.inspect %>')) notice(inline_template('valid_bricks: <%= @valid_bricks.inspect %>')) # NOTE: we're using the valid_bricks value here, and not the collected |