diff --git a/lib/ansible/plugins/action/network.py b/lib/ansible/plugins/action/network.py index d7b8a61f425..277dc708954 100644 --- a/lib/ansible/plugins/action/network.py +++ b/lib/ansible/plugins/action/network.py @@ -40,7 +40,10 @@ class ActionModule(_ActionModule): def run(self, task_vars=None): config_module = hasattr(self, '_config_module') and self._config_module if config_module and self._task.args.get('src'): - self._handle_src_option() + try: + self._handle_src_option() + except AnsibleError as e: + return {'failed': True, 'msg': e.message, 'changed': False} result = super(ActionModule, self).run(task_vars=task_vars)