diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index c211a5b6b1..f0500e1b5f 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -758,9 +758,14 @@ class TaskExecutor: Returns the correct action plugin to handle the requestion task action ''' + network_group_modules = frozenset(['eos', 'nxos', 'ios', 'iosxr', 'junos', 'vyos']) + module_prefix = self._task.action.split('_')[0] + # let action plugin override module, fallback to 'normal' action plugin otherwise if self._task.action in self._shared_loader_obj.action_loader: handler_name = self._task.action + elif all((module_prefix in network_group_modules, module_prefix in self._shared_loader_obj.action_loader)): + handler_name = module_prefix else: pc_conn = self._shared_loader_obj.connection_loader.get(self._play_context.connection, class_only=True) handler_name = getattr(pc_conn, 'action_handler', 'normal')