mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
only do squash when 'squashable field' present
This commit is contained in:
parent
18240d350c
commit
71402abf21
1 changed files with 23 additions and 22 deletions
|
@ -279,6 +279,7 @@ class TaskExecutor:
|
||||||
# This gets the information to check whether the name field
|
# This gets the information to check whether the name field
|
||||||
# contains a template that we can squash for
|
# contains a template that we can squash for
|
||||||
template_no_item = template_with_item = None
|
template_no_item = template_with_item = None
|
||||||
|
if name:
|
||||||
if templar._contains_vars(name):
|
if templar._contains_vars(name):
|
||||||
variables['item'] = '\0$'
|
variables['item'] = '\0$'
|
||||||
template_no_item = templar.template(name, variables, cache=False)
|
template_no_item = templar.template(name, variables, cache=False)
|
||||||
|
@ -289,7 +290,7 @@ class TaskExecutor:
|
||||||
# Check if the user is doing some operation that doesn't take
|
# Check if the user is doing some operation that doesn't take
|
||||||
# name/pkg or the name/pkg field doesn't have any variables
|
# name/pkg or the name/pkg field doesn't have any variables
|
||||||
# and thus the items can't be squashed
|
# and thus the items can't be squashed
|
||||||
if name and (template_no_item != template_with_item):
|
if template_no_item != template_with_item:
|
||||||
for item in items:
|
for item in items:
|
||||||
variables['item'] = item
|
variables['item'] = item
|
||||||
if self._task.evaluate_conditional(templar, variables):
|
if self._task.evaluate_conditional(templar, variables):
|
||||||
|
|
Loading…
Reference in a new issue