1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use combined cache for templating module vars

Fixes #6901
This commit is contained in:
James Tanner 2014-04-15 10:54:43 -05:00 committed by James Cammarata
parent 942c3299ec
commit aad128bac7
2 changed files with 1228 additions and 2 deletions

View file

@ -552,12 +552,14 @@ class Runner(object):
# fireball, local, etc # fireball, local, etc
port = self.remote_port port = self.remote_port
module_vars = template.template(self.basedir, self.module_vars, host_variables)
# merge the VARS and SETUP caches for this host # merge the VARS and SETUP caches for this host
combined_cache = self.setup_cache.copy() combined_cache = self.setup_cache.copy()
combined_cache.get(host, {}).update(self.vars_cache.get(host, {})) combined_cache.get(host, {}).update(self.vars_cache.get(host, {}))
# use combined_cache and host_variables to template the module_vars
module_vars_inject = utils.combine_vars(combined_cache.get(host, {}), host_variables)
module_vars = template.template(self.basedir, self.module_vars, module_vars_inject)
inject = {} inject = {}
inject = utils.combine_vars(inject, self.default_vars) inject = utils.combine_vars(inject, self.default_vars)
inject = utils.combine_vars(inject, host_variables) inject = utils.combine_vars(inject, host_variables)

File diff suppressed because it is too large Load diff