From 60d84aca07713ed014b969d3329c5281745d9fa5 Mon Sep 17 00:00:00 2001 From: afunix Date: Sat, 8 Oct 2016 14:15:55 -0500 Subject: [PATCH] gluster_volume adds replica and stripe arguments when adding bricks [#2754] (#2812) --- lib/ansible/modules/extras/system/gluster_volume.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/system/gluster_volume.py b/lib/ansible/modules/extras/system/gluster_volume.py index 820b7ef2d5c..ceb63300673 100644 --- a/lib/ansible/modules/extras/system/gluster_volume.py +++ b/lib/ansible/modules/extras/system/gluster_volume.py @@ -317,8 +317,14 @@ def stop_volume(name): def set_volume_option(name, option, parameter): run_gluster([ 'volume', 'set', name, option, parameter ]) -def add_bricks(name, new_bricks, force): +def add_bricks(name, new_bricks, stripe, replica, force): args = [ 'volume', 'add-brick', name ] + if stripe: + args.append('stripe') + args.append(str(stripe)) + if replica: + args.append('replica') + args.append(str(replica)) args.extend(new_bricks) if force: args.append('force') @@ -445,7 +451,7 @@ def main(): removed_bricks.append(brick) if new_bricks: - add_bricks(volume_name, new_bricks, force) + add_bricks(volume_name, new_bricks, stripes, replicas, force) changed = True # handle quotas