From df89f03627df66c5f3815a740c5bf41c792b0bd3 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 11 Sep 2015 12:24:44 -0400 Subject: [PATCH] Fixing precedence order for new nonpersistent vars (set_fact/register) These used to go in vars_cache, so merging them in after that as they are "live" variables and the user would most likely want to see these above anything else. --- lib/ansible/vars/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 52679b11ca..6a1efa4a39 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -206,7 +206,6 @@ class VariableManager: if host_facts[k] is not None and not isinstance(host_facts[k], UnsafeProxy): host_facts[k] = UnsafeProxy(host_facts[k]) all_vars = combine_vars(all_vars, host_facts) - all_vars = combine_vars(all_vars, self._nonpersistent_fact_cache.get(host.name, dict())) except KeyError: pass @@ -252,6 +251,7 @@ class VariableManager: if host: all_vars = combine_vars(all_vars, self._vars_cache.get(host.get_name(), dict())) + all_vars = combine_vars(all_vars, self._nonpersistent_fact_cache.get(host.name, dict())) all_vars = combine_vars(all_vars, self._extra_vars)