From 6777268f4ce289f06f6e7326b4c50eb6916cc9ce Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 18 Mar 2012 17:24:09 -0400 Subject: [PATCH] Fixup the code that allows facter/ohai/other data to bubble up and be used in future action lines. It's a niche case compared to usage in templates but it should work and will be wanted later for conditional support. --- lib/ansible/runner.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 2747b4a5fda..b1c82153529 100755 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -371,6 +371,15 @@ class Runner(object): except: var_result = {} + # note: do not allow variables from playbook to be stomped on + # by variables coming up from facter/ohai/etc. They + # should be prefixed anyway + if not host in self.setup_cache: + self.setup_cache[host] = {} + for (k, v) in var_result.iteritems(): + if not k in self.setup_cache[host]: + self.setup_cache[host][k] = v + return self._return_from_module(conn, host, result) # *****************************************************