mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-04 16:21:28 -07:00
changed to default 'auto' as it better describes the use= option
This commit is contained in:
parent
d2f93511df
commit
978390693b
1 changed files with 6 additions and 5 deletions
|
@ -29,20 +29,21 @@ class ActionModule(ActionBase):
|
||||||
|
|
||||||
name = self._task.args.get('name', None)
|
name = self._task.args.get('name', None)
|
||||||
state = self._task.args.get('state', None)
|
state = self._task.args.get('state', None)
|
||||||
module = self._task.args.get('use', None)
|
module = self._task.args.get('use', 'auto')
|
||||||
|
|
||||||
if module is None:
|
if module == 'auto':
|
||||||
try:
|
try:
|
||||||
module = self._templar.template('{{ansible_pkg_mgr}}')
|
module = self._templar.template('{{ansible_pkg_mgr}}')
|
||||||
except:
|
except:
|
||||||
pass # could not get it from template!
|
pass # could not get it from template!
|
||||||
|
|
||||||
if module is None:
|
if module == 'auto':
|
||||||
#TODO: autodetect the package manager, by invoking that specific fact snippet remotely
|
#FIXME: autodetect the package manager run facts module remotely to get ansible_pkg_mgr
|
||||||
|
#module = self._execute_module(module_name=setup, module_args={filter: 'ansible_pkg_mgr'}, task_vars=task_vars)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if module is not None:
|
if module != 'auto':
|
||||||
# run the 'package' module
|
# run the 'package' module
|
||||||
new_module_args = self._task.args.copy()
|
new_module_args = self._task.args.copy()
|
||||||
if 'use' in new_module_args:
|
if 'use' in new_module_args:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue