From 6c5761a79e5fe949a9f51d0dcf57eac1b103c128 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 10 Aug 2012 00:58:53 -0400 Subject: [PATCH] Store the ${last_result} for each host to make it usable in only_if conditionals and such. --- CHANGELOG.md | 1 + lib/ansible/playbook/__init__.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77a185aa5f3..596a7088ad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Ansible Changes By Release * allow variables in parameterized task include parameters (regression) * make remote_md5 internal function work with non-bash shells * 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 diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py index 9555d7eda13..f162428c18c 100644 --- a/lib/ansible/playbook/__init__.py +++ b/lib/ansible/playbook/__init__.py @@ -224,6 +224,7 @@ class PlayBook(object): for host, result in results['contacted'].iteritems(): facts = result.get('ansible_facts', {}) self.SETUP_CACHE[host].update(facts) + self.SETUP_CACHE[host]['last_result'] = result # flag which notify handlers need to be run if len(task.notify) > 0: