From 0211fb7a78b9ea74be1a507803687602f1ce66bd Mon Sep 17 00:00:00 2001 From: Sachidananda Urs Date: Fri, 25 May 2018 02:30:11 +0530 Subject: [PATCH] gluster_volume: Fix `volume set' and `quota' features (#40438) (#40644) * Add documentation for setting multiple options. * Do not set `cluster' to myhostname, if cluster is not set. This will cause parse error, since module will try to parse the brick and hosts. * Also fixes issue #40410 --- lib/ansible/modules/system/gluster_volume.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/gluster_volume.py b/lib/ansible/modules/system/gluster_volume.py index 816a8f7e133..73b7e57de97 100644 --- a/lib/ansible/modules/system/gluster_volume.py +++ b/lib/ansible/modules/system/gluster_volume.py @@ -111,6 +111,16 @@ EXAMPLES = """ options: performance.cache-size: 256MB +- name: Set multiple options on GlusterFS volume + gluster_volume: + state: present + name: test1 + options: + { performance.cache-size: 128MB, + write-behind: 'off', + quick-read: 'on' + } + - name: start gluster volume gluster_volume: state: started @@ -409,8 +419,8 @@ def main(): if cluster is not None and len(cluster) > 1 and cluster[-1] == '': cluster = cluster[0:-1] - if cluster is None or cluster[0] == '': - cluster = [myhostname] + if cluster is None: + cluster = [] if brick_paths is not None and "," in brick_paths: brick_paths = brick_paths.split(",")