summaryrefslogtreecommitdiff
path: root/system/gluster_volume.py
diff options
context:
space:
mode:
authorDmitry Bashkatov <dbashkatov@gmail.com>2015-03-11 16:40:22 +0300
committerDmitry Bashkatov <dbashkatov@gmail.com>2015-03-11 16:40:22 +0300
commit26c2080dcfefda4fbdea6ab8917f734401c19e20 (patch)
tree1449f2ae0eacf3d3de68baf3525913546121cf81 /system/gluster_volume.py
parentc6448660a3cd0a4078f9ab2cd0b6c5c1b83470d3 (diff)
downloadansible-modules-extras-26c2080dcfefda4fbdea6ab8917f734401c19e20.tar.gz
gluster_volume: use force option during add-brick
Diffstat (limited to 'system/gluster_volume.py')
-rw-r--r--system/gluster_volume.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/system/gluster_volume.py b/system/gluster_volume.py
index 91a717aa..3f735a12 100644
--- a/system/gluster_volume.py
+++ b/system/gluster_volume.py
@@ -262,8 +262,11 @@ def main():
def set_volume_option(name, option, parameter):
run_gluster([ 'volume', 'set', name, option, parameter ])
- def add_brick(name, brick):
- run_gluster([ 'volume', 'add-brick', name, brick ])
+ def add_brick(name, brick, force):
+ args = [ 'volume', 'add-brick', name, brick ]
+ if force:
+ args.append('force')
+ run_gluster(args)
def rebalance(name):
run_gluster(['volume', 'rebalance', name, 'start'])
@@ -363,7 +366,7 @@ def main():
removed_bricks.append(brick)
for brick in new_bricks:
- add_brick(volume_name, brick)
+ add_brick(volume_name, brick, force)
changed = True
# handle quotas