|
|
@ -41,6 +41,13 @@ class ActionModule(ActionBase):
|
|
|
|
facts = self._execute_module(
|
|
|
|
facts = self._execute_module(
|
|
|
|
module_name="ansible.legacy.setup", module_args=dict(filter="ansible_pkg_mgr", gather_subset="!all"),
|
|
|
|
module_name="ansible.legacy.setup", module_args=dict(filter="ansible_pkg_mgr", gather_subset="!all"),
|
|
|
|
task_vars=task_vars)
|
|
|
|
task_vars=task_vars)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if facts.get("failed", False):
|
|
|
|
|
|
|
|
raise AnsibleActionFail(
|
|
|
|
|
|
|
|
f"Failed to fetch ansible_pkg_mgr to determine the dnf action backend: {facts.get('msg')}",
|
|
|
|
|
|
|
|
result=facts,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
display.debug("Facts %s" % facts)
|
|
|
|
display.debug("Facts %s" % facts)
|
|
|
|
module = facts.get("ansible_facts", {}).get("ansible_pkg_mgr", "auto")
|
|
|
|
module = facts.get("ansible_facts", {}).get("ansible_pkg_mgr", "auto")
|
|
|
|
if (not self._task.delegate_to or self._task.delegate_facts) and module != 'auto':
|
|
|
|
if (not self._task.delegate_to or self._task.delegate_facts) and module != 'auto':
|
|
|
@ -75,9 +82,4 @@ class ActionModule(ActionBase):
|
|
|
|
result.update(self._execute_module(
|
|
|
|
result.update(self._execute_module(
|
|
|
|
module_name=module, module_args=new_module_args, task_vars=task_vars, wrap_async=self._task.async_val))
|
|
|
|
module_name=module, module_args=new_module_args, task_vars=task_vars, wrap_async=self._task.async_val))
|
|
|
|
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
|
|
|
|
if not self._task.async_val:
|
|
|
|
|
|
|
|
# remove a temporary path we created
|
|
|
|
|
|
|
|
self._remove_tmp_path(self._connection._shell.tmpdir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|