mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-01 20:50:23 -07:00
package and service now check that module exists before trying to execute it
This commit is contained in:
parent
bca4e23b27
commit
7458331539
2 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,7 @@ __metaclass__ = type
|
|||
|
||||
from ansible.plugins.action import ActionBase
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
|
||||
TRANSFERS_FILES = False
|
||||
|
@ -43,7 +44,7 @@ class ActionModule(ActionBase):
|
|||
if not 'failed' in facts:
|
||||
module = getattr(facts['ansible_facts'], 'ansible_service_mgr', 'auto')
|
||||
|
||||
if not module or module == 'auto':
|
||||
if not module or module == 'auto' or module not in self._shared_loader_obj.module_loader:
|
||||
module = 'service'
|
||||
|
||||
if module != 'auto':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue