summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael DeHaan <michael.dehaan@gmail.com>2012-10-03 04:05:54 +0200
committerMichael DeHaan <michael.dehaan@gmail.com>2012-10-03 04:05:54 +0200
commit212296e59c99f6c64d77747e8ea24ced7b2f7aee (patch)
tree8ae5b6cfc7a348f24fc89f6a35e84f3f4fe4266d /lib
parentMerge pull request #1202 from dagwieers/abort-play-abort-playbook (diff)
parentFix gather_facts assumption that SETUP_CACHE for a host is empty (diff)
downloadansible-212296e59c99f6c64d77747e8ea24ced7b2f7aee.tar.xz
ansible-212296e59c99f6c64d77747e8ea24ced7b2f7aee.zip
Merge pull request #1207 from dagwieers/gather_facts-fix
Fix gather_facts assumption that SETUP_CACHE for a host is empty
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/playbook/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py
index 114da81a89..00f3e10467 100644
--- a/lib/ansible/playbook/__init__.py
+++ b/lib/ansible/playbook/__init__.py
@@ -312,7 +312,7 @@ class PlayBook(object):
if play.gather_facts is False:
return {}
elif play.gather_facts is None:
- host_list = [h for h in host_list if h not in self.SETUP_CACHE]
+ host_list = [h for h in host_list if h not in self.SETUP_CACHE or 'module_setup' not in self.SETUP_CACHE[h]]
if len(host_list) == 0:
return {}
@@ -335,6 +335,7 @@ class PlayBook(object):
# let runner template out future commands
setup_ok = setup_results.get('contacted', {})
for (host, result) in setup_ok.iteritems():
+ self.SETUP_CACHE[host].update({'module_setup': True})
self.SETUP_CACHE[host].update(result.get('ansible_facts', {}))
return setup_results