diff --git a/lib/ansible/modules/core b/lib/ansible/modules/core index 617a52b20d5..9b35a391213 160000 --- a/lib/ansible/modules/core +++ b/lib/ansible/modules/core @@ -1 +1 @@ -Subproject commit 617a52b20d512a4eb5e88fdc76658b220ff80266 +Subproject commit 9b35a391213fe87834af5ebc907109de2bc0005f diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 014cb6276a9..a76e6863ba4 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -1213,7 +1213,7 @@ class Runner(object): # Search module path(s) for named module. module_suffixes = getattr(conn, 'default_suffixes', None) - module_path = utils.plugins.module_finder.find_plugin(module_name, module_suffixes) + module_path = utils.plugins.module_finder.find_plugin(module_name, module_suffixes, transport=self.transport) if module_path is None: module_path2 = utils.plugins.module_finder.find_plugin('ping', module_suffixes) if module_path2 is not None: diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index 816bf19c695..800802bc156 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -159,14 +159,17 @@ class PluginLoader(object): if directory not in self._extra_dirs: self._extra_dirs.append(directory) - def find_plugin(self, name, suffixes=None): + def find_plugin(self, name, suffixes=None, transport=''): ''' Find a plugin named name ''' if not suffixes: if self.class_name: suffixes = ['.py'] else: - suffixes = ['', '.ps1', '.py'] + if transport == 'winrm': + suffixes = ['.ps1', ''] + else: + suffixes = ['.py', ''] for suffix in suffixes: full_name = '%s%s' % (name, suffix)