From 4b0480dd9d3836b0cd5efe8c860ed2886eccd294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20N=C3=A9ri?= Date: Sun, 13 May 2012 20:36:08 +0200 Subject: [PATCH] Set 'hostvars' before performing variable replacements --- lib/ansible/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 29b164de91..aacc9d5d6d 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -257,8 +257,8 @@ def varReplace(raw, vars): def template(text, vars, setup_cache, no_engine=True): ''' run a text buffer through the templating engine ''' vars = vars.copy() - text = varReplace(unicode(text), vars) vars['hostvars'] = setup_cache + text = varReplace(unicode(text), vars) if no_engine: # used when processing include: directives so that Jinja is evaluated # in a later context when more variables are available