mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 14:29:10 -07:00
check for failure in fact gathering
This commit is contained in:
parent
1edae51e05
commit
7a51836530
2 changed files with 4 additions and 3 deletions
|
@ -40,7 +40,8 @@ class ActionModule(ActionBase):
|
|||
if module == 'auto':
|
||||
facts = self._execute_module(module_name='setup', module_args=dict(filter='ansible_service_mgr'), task_vars=task_vars)
|
||||
self._display.debug("Facts %s" % facts)
|
||||
module = getattr(facts['ansible_facts'], 'ansible_service_mgr', 'auto')
|
||||
if not 'failed' in facts:
|
||||
module = getattr(facts['ansible_facts'], 'ansible_service_mgr', 'auto')
|
||||
|
||||
if not module or module == 'auto':
|
||||
module = 'service'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue