1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

selective: mark task failed correctly (#629)

Added additional condition to detect failed task in
selective callback plugin when ran with loop or with_items.

Fixes: ansible/ansible#63767

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2020-07-12 03:56:58 +05:30 committed by GitHub
parent b31de003bd
commit 151551b04f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- selective - mark task failed correctly (https://github.com/ansible/ansible/issues/63767).

View file

@ -201,7 +201,7 @@ class CallbackModule(CallbackBase):
)
if 'results' in result._result:
for r in result._result['results']:
failed = 'failed' in r
failed = 'failed' in r and r['failed']
stderr = [r.get('exception', None), r.get('module_stderr', None)]
stderr = "\n".join([e for e in stderr if e]).strip()