Fix incorrect msg in the results dict in loops (#71482)
This commit is contained in:
parent
a1a624b150
commit
50f221c63e
7 changed files with 8 additions and 6 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Fix incorrect msg in the results dict in loops
|
|
@ -145,7 +145,7 @@ class TaskExecutor:
|
||||||
res[array] = res[array] + item[array]
|
res[array] = res[array] + item[array]
|
||||||
del item[array]
|
del item[array]
|
||||||
|
|
||||||
if not res.get('Failed', False):
|
if not res.get('failed', False):
|
||||||
res['msg'] = 'All items completed'
|
res['msg'] = 'All items completed'
|
||||||
else:
|
else:
|
||||||
res = dict(changed=False, skipped=True, skipped_reason='No items in the list', results=[])
|
res = dict(changed=False, skipped=True, skipped_reason='No items in the list', results=[])
|
||||||
|
|
|
@ -33,7 +33,7 @@ ok: [testhost] => (item=debug-3) => {
|
||||||
"msg": "debug-3"
|
"msg": "debug-3"
|
||||||
}
|
}
|
||||||
skipping: [testhost] => (item=debug-4)
|
skipping: [testhost] => (item=debug-4)
|
||||||
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
|
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
|
||||||
...ignoring
|
...ignoring
|
||||||
|
|
||||||
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
+ ansible-playbook -i inventory test.yml
|
+ ansible-playbook -i inventory test.yml
|
||||||
++ set +x
|
++ set +x
|
||||||
fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"}
|
fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"}
|
||||||
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
|
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
|
||||||
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}
|
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}
|
||||||
|
|
|
@ -27,7 +27,7 @@ failed: [testhost] (item=debug-2) => {
|
||||||
"msg": "debug-2"
|
"msg": "debug-2"
|
||||||
}
|
}
|
||||||
skipping: [testhost] => (item=debug-4)
|
skipping: [testhost] => (item=debug-4)
|
||||||
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
|
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
|
||||||
...ignoring
|
...ignoring
|
||||||
|
|
||||||
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
||||||
|
|
|
@ -29,7 +29,7 @@ failed: [testhost] (item=debug-2) => {
|
||||||
ok: [testhost] => (item=debug-3) => {
|
ok: [testhost] => (item=debug-3) => {
|
||||||
"msg": "debug-3"
|
"msg": "debug-3"
|
||||||
}
|
}
|
||||||
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
|
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
|
||||||
...ignoring
|
...ignoring
|
||||||
|
|
||||||
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
||||||
|
|
|
@ -23,7 +23,7 @@ changed: [testhost] => (item=debug-1) => {
|
||||||
failed: [testhost] (item=debug-2) => {
|
failed: [testhost] (item=debug-2) => {
|
||||||
"msg": "debug-2"
|
"msg": "debug-2"
|
||||||
}
|
}
|
||||||
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
|
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
|
||||||
...ignoring
|
...ignoring
|
||||||
|
|
||||||
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************
|
||||||
|
|
Loading…
Reference in a new issue