diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 0a5610834a1..efb3867d325 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -2441,9 +2441,11 @@ class AnsibleModule(object): rc = cmd.returncode except (OSError, IOError): e = get_exception() + self.log("%s: Error Executing CMD:%s PERM:%s Exception:%s" % (args[0] , args[1] , str(e))) self.fail_json(rc=e.errno, msg=to_native(e), cmd=clean_args) except Exception: e = get_exception() + self.log("%s: Error Executing CMD:%s PERM:%s Exception:%s" % (args[0] , args[1] , str(traceback.format_exc()))) self.fail_json(rc=257, msg=to_native(e), exception=traceback.format_exc(), cmd=clean_args) # Restore env settings