mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
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
This commit is contained in:
@@ -580,7 +580,7 @@ class Runner(object):
|
|||||||
# we update the inject variables with the data we're about to template
|
# 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
|
# 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 = 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)
|
module_vars = template.template(self.basedir, self.module_vars, module_vars_inject)
|
||||||
|
|
||||||
inject = {}
|
inject = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user