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

Merge pull request #1179 from dhozac/fix-per-task-mv

Give each task its own module_vars
This commit is contained in:
Michael DeHaan 2012-10-01 08:19:43 -07:00
commit f785f1ea15

View file

@ -116,8 +116,9 @@ class Play(object):
mv[k] = utils.varReplaceWithItems(self.basedir, v, mv) mv[k] = utils.varReplaceWithItems(self.basedir, v, mv)
include_file = utils.template(self.basedir, tokens[0], mv) include_file = utils.template(self.basedir, tokens[0], mv)
data = utils.parse_yaml_from_file(utils.path_dwim(self.basedir, include_file)) data = utils.parse_yaml_from_file(utils.path_dwim(self.basedir, include_file))
print data
for y in data: for y in data:
results.append(Task(self,y,module_vars=mv)) results.append(Task(self,y,module_vars=mv.copy()))
elif type(x) == dict: elif type(x) == dict:
task_vars = self.vars.copy() task_vars = self.vars.copy()
results.append(Task(self,x,module_vars=task_vars)) results.append(Task(self,x,module_vars=task_vars))