From af51a5086370879c307ab6e493ff9bcc8b1a02be Mon Sep 17 00:00:00 2001 From: Jonathan Mainguy Date: Sun, 19 Apr 2015 15:29:30 -0400 Subject: [PATCH] Fixes bug where state=absent did not work --- lib/ansible/modules/extras/system/gluster_volume.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/gluster_volume.py b/lib/ansible/modules/extras/system/gluster_volume.py index c1607f627c..2e45a58cc8 100644 --- a/lib/ansible/modules/extras/system/gluster_volume.py +++ b/lib/ansible/modules/extras/system/gluster_volume.py @@ -356,7 +356,9 @@ def main(): # do the work! if action == 'absent': if volume_name in volumes: - run_gluster([ 'volume', 'delete', name ]) + if volumes[volume_name]['status'].lower() != 'stopped': + stop_volume(volume_name) + run_gluster_yes([ 'volume', 'delete', volume_name ]) changed = True if action == 'present':