From d77a6965b3d1f40fdf476705a04c0c9a681fbf6b Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 23 May 2014 13:36:45 -0500 Subject: [PATCH] Merge module_vars into inject during template instead of updating This way we won't overwrite values that are stored in the inject with module_vars that should be lower precedence. Fixes #7510 --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index adc9b7bcbd..9526ecb2d7 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -580,7 +580,7 @@ class Runner(object): # we update the inject variables with the data we're about to template # since some of the variables we'll be replacing may be contained there too module_vars_inject = utils.combine_vars(combined_cache.get(host, {}), host_variables) - module_vars_inject.update(self.module_vars) + module_vars_inject = utils.combine_vars(self.module_vars, module_vars_inject) module_vars = template.template(self.basedir, self.module_vars, module_vars_inject) inject = {}