From a83aa1071b7407a06e7ca2f3c2f2f16213f0e170 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 1 Oct 2012 17:17:39 +0200 Subject: [PATCH] Give each task its own module_vars Otherwise each task will overwrite the previous' items, among other things. --- lib/ansible/playbook/play.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index bb73d09b0d..bb8bea5132 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -116,8 +116,9 @@ class Play(object): mv[k] = utils.varReplaceWithItems(self.basedir, v, mv) include_file = utils.template(self.basedir, tokens[0], mv) data = utils.parse_yaml_from_file(utils.path_dwim(self.basedir, include_file)) + print 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: task_vars = self.vars.copy() results.append(Task(self,x,module_vars=task_vars))