diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py index e61dd93ca8..ab194a7696 100644 --- a/lib/ansible/module_utils/ios.py +++ b/lib/ansible/module_utils/ios.py @@ -127,6 +127,8 @@ class NetworkModule(AnsibleModule): def execute(self, commands, **kwargs): try: return self.connection.send(commands, **kwargs) + except ShellError, exc: + self.fail_json(msg=exc.message, command=exc.command) except Exception, exc: self.fail_json(msg=exc.message, commands=commands)