Commit b5e487f2 by Michael DeHaan

Merge pull request #6290 from lberruti/fix_complex_args

fixes #6244
parents 40ee0307 7cf36391
...@@ -618,13 +618,13 @@ class Runner(object): ...@@ -618,13 +618,13 @@ class Runner(object):
all_failed = False all_failed = False
results = [] results = []
for x in items: for x in items:
# use a fresh inject for each item # use a fresh inject for each item
this_inject = inject.copy() this_inject = inject.copy()
this_inject['item'] = x this_inject['item'] = x
# TODO: this idiom should be replaced with an up-conversion to a Jinja2 template evaluation # TODO: this idiom should be replaced with an up-conversion to a Jinja2 template evaluation
if isinstance(self.complex_args, basestring): if isinstance(self.complex_args, basestring):
complex_args = template.template(self.basedir, self.complex_args, inject, convert_bare=True) complex_args = template.template(self.basedir, self.complex_args, this_inject, convert_bare=True)
complex_args = utils.safe_eval(complex_args) complex_args = utils.safe_eval(complex_args)
if type(complex_args) != dict: if type(complex_args) != dict:
raise errors.AnsibleError("args must be a dictionary, received %s" % complex_args) raise errors.AnsibleError("args must be a dictionary, received %s" % complex_args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment