summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/action/yum.py
diff options
context:
space:
mode:
authorcos <cos>2024-04-20 09:49:20 +0200
committercos <cos>2024-04-20 09:49:20 +0200
commit4a8cba9f5881c02efe11c043d91b22325a591579 (patch)
tree6c52b3df5315ddae440dd6d6d2526f0481aecee2 /lib/ansible/plugins/action/yum.py
parent3280e8181e83872988933ea71b89ae891749a872 (diff)
parentbbed591285e1882d05198e518f75873af58939f5 (diff)
downloaddebian-ansible-core-debian/failed-recreation-attempt.zip
Update upstream source from recreated 2.16.5 importdebian/failed-recreation-attempt
Diffstat (limited to 'lib/ansible/plugins/action/yum.py')
-rw-r--r--lib/ansible/plugins/action/yum.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ansible/plugins/action/yum.py b/lib/ansible/plugins/action/yum.py
index d90a9e00..9121e812 100644
--- a/lib/ansible/plugins/action/yum.py
+++ b/lib/ansible/plugins/action/yum.py
@@ -23,7 +23,7 @@ from ansible.utils.display import Display
display = Display()
-VALID_BACKENDS = frozenset(('yum', 'yum4', 'dnf'))
+VALID_BACKENDS = frozenset(('yum', 'yum4', 'dnf', 'dnf4', 'dnf5'))
class ActionModule(ActionBase):
@@ -53,6 +53,9 @@ class ActionModule(ActionBase):
module = self._task.args.get('use', self._task.args.get('use_backend', 'auto'))
+ if module == 'dnf':
+ module = 'auto'
+
if module == 'auto':
try:
if self._task.delegate_to: # if we delegate, we should use delegated host's facts
@@ -81,7 +84,7 @@ class ActionModule(ActionBase):
)
else:
- if module == "yum4":
+ if module in {"yum4", "dnf4"}:
module = "dnf"
# eliminate collisions with collections search while still allowing local override
@@ -90,7 +93,6 @@ class ActionModule(ActionBase):
if not self._shared_loader_obj.module_loader.has_plugin(module):
result.update({'failed': True, 'msg': "Could not find a yum module backend for %s." % module})
else:
- # run either the yum (yum3) or dnf (yum4) backend module
new_module_args = self._task.args.copy()
if 'use_backend' in new_module_args:
del new_module_args['use_backend']