From 73a9abd1c80e2a975c8f9104cb69f03e2e4e51e2 Mon Sep 17 00:00:00 2001 From: "Jose A. Rivera" Date: Sun, 10 Jan 2016 12:45:32 -0600 Subject: [PATCH] gluster_volume: allow probing ourselves We should allow "gluster peer probe" to determine if a given "host" maps to the localhost, and detect that case accordingly. --- lib/ansible/modules/extras/system/gluster_volume.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/system/gluster_volume.py b/lib/ansible/modules/extras/system/gluster_volume.py index 6dd03892a3c..df185591299 100644 --- a/lib/ansible/modules/extras/system/gluster_volume.py +++ b/lib/ansible/modules/extras/system/gluster_volume.py @@ -249,8 +249,8 @@ def wait_for_peer(host): def probe(host, myhostname): global module - run_gluster([ 'peer', 'probe', host ]) - if not wait_for_peer(host): + out = run_gluster([ 'peer', 'probe', host ]) + if not out.find('localhost') and not wait_for_peer(host): module.fail_json(msg='failed to probe peer %s on %s' % (host, myhostname)) changed = True @@ -258,9 +258,7 @@ def probe_all_peers(hosts, peers, myhostname): for host in hosts: host = host.strip() # Clean up any extra space for exact comparison if host not in peers: - # dont probe ourselves - if myhostname != host: - probe(host, myhostname) + probe(host, myhostname) def create_volume(name, stripe, replica, transport, hosts, bricks, force): args = [ 'volume', 'create' ]