mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a successful run, similar to #24865 for Windows fixing **win_chocolatey**. We also disable the dependency on `rc` value only, even if `failed` was set. Adapted unit and integration tests to the new scheme. Updated raw, shell, script, expect to take `rc` into account.
This commit is contained in:
committed by
Toshio Kuratomi
parent
1f78715848
commit
0e160d5c7e
@@ -93,4 +93,8 @@ class ActionModule(ActionBase):
|
||||
|
||||
result['changed'] = True
|
||||
|
||||
if 'rc' in result and result['rc'] != 0:
|
||||
result['failed'] = True
|
||||
result['msg'] = 'non-zero return code'
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user