Allow squashed loop items to use name=foo-{{item}}
Fixes #9235 Fixes #11184
This commit is contained in:
parent
9911a947ed
commit
b723f9a09a
1 changed files with 8 additions and 2 deletions
|
@ -186,8 +186,14 @@ class TaskExecutor:
|
|||
variables['item'] = item
|
||||
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=variables)
|
||||
if self._task.evaluate_conditional(templar, variables):
|
||||
final_items.append(item)
|
||||
return [",".join(final_items)]
|
||||
if templar._contains_vars(self._task.args['name']):
|
||||
new_item = templar.template(self._task.args['name'])
|
||||
final_items.append(new_item)
|
||||
else:
|
||||
final_items.append(item)
|
||||
joined_items = ",".join(final_items)
|
||||
self._task.args['name'] = joined_items
|
||||
return [joined_items]
|
||||
else:
|
||||
return items
|
||||
|
||||
|
|
Loading…
Reference in a new issue