mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
package and service now check that module exists before trying to execute it
This commit is contained in:
@@ -44,6 +44,10 @@ class ActionModule(ActionBase):
|
||||
module = getattr(facts['ansible_facts'], 'ansible_pkg_mgr', 'auto')
|
||||
|
||||
if module != 'auto':
|
||||
|
||||
if module not in self._shared_loader_obj.module_loader:
|
||||
return {'failed': True, 'msg': 'Could not find a module for %s.' % module}
|
||||
|
||||
# run the 'package' module
|
||||
new_module_args = self._task.args.copy()
|
||||
if 'use' in new_module_args:
|
||||
|
||||
Reference in New Issue
Block a user