parent
ba8a05daab
commit
64bb54dab4
2 changed files with 12 additions and 1 deletions
|
@ -0,0 +1,5 @@
|
|||
bugfixes:
|
||||
- loop_control - Catch exceptions when templating label individually for loop
|
||||
iterations which caused the templating failure as the full
|
||||
result. This instead only registers the templating exception for a single
|
||||
loop result (https://github.com/ansible/ansible/issues/48879)
|
|
@ -361,7 +361,13 @@ class TaskExecutor:
|
|||
res['_ansible_ignore_errors'] = task_fields.get('ignore_errors')
|
||||
|
||||
# gets templated here unlike rest of loop_control fields, depends on loop_var above
|
||||
res['_ansible_item_label'] = templar.template(label, cache=False)
|
||||
try:
|
||||
res['_ansible_item_label'] = templar.template(label, cache=False)
|
||||
except AnsibleUndefinedVariable as e:
|
||||
res.update({
|
||||
'failed': True,
|
||||
'msg': 'Failed to template loop_control.label: %s' % to_text(e)
|
||||
})
|
||||
|
||||
self._final_q.put(
|
||||
TaskResult(
|
||||
|
|
Loading…
Reference in a new issue