1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Store the ${last_result} for each host to make it usable in only_if conditionals and such.

This commit is contained in:
Michael DeHaan 2012-08-10 00:58:53 -04:00
parent 58e099b91b
commit 6c5761a79e
2 changed files with 2 additions and 0 deletions

View file

@ -27,6 +27,7 @@ Ansible Changes By Release
* allow variables in parameterized task include parameters (regression) * allow variables in parameterized task include parameters (regression)
* make remote_md5 internal function work with non-bash shells * make remote_md5 internal function work with non-bash shells
* allow user to be passed in via --extra-vars (regression) * allow user to be passed in via --extra-vars (regression)
* ${last_result} variable stores the last result for each host
0.6 "Cabo" -- August 6, 2012 0.6 "Cabo" -- August 6, 2012

View file

@ -224,6 +224,7 @@ class PlayBook(object):
for host, result in results['contacted'].iteritems(): for host, result in results['contacted'].iteritems():
facts = result.get('ansible_facts', {}) facts = result.get('ansible_facts', {})
self.SETUP_CACHE[host].update(facts) self.SETUP_CACHE[host].update(facts)
self.SETUP_CACHE[host]['last_result'] = result
# flag which notify handlers need to be run # flag which notify handlers need to be run
if len(task.notify) > 0: if len(task.notify) > 0: