diff --git a/lib/ansible/modules/extras/commands/expect.py b/lib/ansible/modules/extras/commands/expect.py index 4b5e5e8d62..a3d1b32d71 100644 --- a/lib/ansible/modules/extras/commands/expect.py +++ b/lib/ansible/modules/extras/commands/expect.py @@ -224,7 +224,7 @@ def main(): changed=True, ) - if rc: + if rc is not None: module.exit_json(**ret) else: ret['msg'] = 'command exceeded timeout'