Things that happen inside multiprocessing shouldn't make side effects, ergo append ansible_facts only

in playbook code.

This technically means with_items calls can't continuously add facts I guess, but I can't see anyone
ever trying that.
This commit is contained in:
Michael DeHaan 2012-07-25 21:30:49 -04:00
parent 51739fc47d
commit 19fc8eea80
2 changed files with 5 additions and 2 deletions

View file

@ -221,6 +221,11 @@ class PlayBook(object):
results = {}
self.stats.compute(results)
# add facts to the global setup cache
for host, result in results['contacted'].iteritems():
facts = result.get('ansible_facts', {})
self.SETUP_CACHE[host].update(facts)
# flag which notify handlers need to be run
if len(task.notify) > 0: