fixed adhoc fact gathering
This commit is contained in:
parent
0381923333
commit
172e0c328c
1 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,10 @@ class ActionModule(ActionBase):
|
||||||
pass # could not get it from template!
|
pass # could not get it from template!
|
||||||
|
|
||||||
if module == 'auto':
|
if module == 'auto':
|
||||||
module = self._execute_module(module_name='setup', module_args={filter: 'ansible_pkg_mgr'}, task_vars=task_vars)
|
facts = self._execute_module(module_name='setup', module_args=dict(filter='ansible_pkg_mgr'), task_vars=task_vars)
|
||||||
|
self._display.degug("Facts %s" % facts)
|
||||||
|
module = getattr(facts['ansible_facts'], 'ansible_pkg_mgr', 'auto')
|
||||||
|
|
||||||
|
|
||||||
if module != 'auto':
|
if module != 'auto':
|
||||||
# run the 'package' module
|
# run the 'package' module
|
||||||
|
@ -46,6 +49,7 @@ class ActionModule(ActionBase):
|
||||||
if 'use' in new_module_args:
|
if 'use' in new_module_args:
|
||||||
del new_module_args['use']
|
del new_module_args['use']
|
||||||
|
|
||||||
|
self._display.vvvv("Running %s" % module)
|
||||||
return self._execute_module(module_name=module, module_args=new_module_args, task_vars=task_vars)
|
return self._execute_module(module_name=module, module_args=new_module_args, task_vars=task_vars)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue