dnf5: re-introduce `state: installed` alias (#83961)

Fixes #83960
This commit is contained in:
Martin Krizek 2024-09-23 09:33:38 +02:00 committed by GitHub
parent 6efb30b43e
commit aa24e97435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- "dnf5 - re-introduce the ``state: installed`` alias to ``state: present`` (https://github.com/ansible/ansible/issues/83960)"

View File

@ -655,7 +655,7 @@ class Dnf5Module(YumDnf):
results = []
if self.names == ["*"] and self.state == "latest":
goal.add_rpm_upgrade(settings)
elif self.state in {"install", "present", "latest"}:
elif self.state in {"installed", "present", "latest"}:
upgrade = self.state == "latest"
for spec in self.names:
if is_newer_version_installed(base, spec):
@ -688,7 +688,7 @@ class Dnf5Module(YumDnf):
if transaction.get_problems():
failures = []
for log_event in transaction.get_resolve_logs():
if log_event.get_problem() == libdnf5.base.GoalProblem_NOT_FOUND and self.state in {"install", "present", "latest"}:
if log_event.get_problem() == libdnf5.base.GoalProblem_NOT_FOUND and self.state in {"installed", "present", "latest"}:
# NOTE dnf module compat
failures.append("No package {} available.".format(log_event.get_spec()))
else:

View File

@ -2,7 +2,7 @@
- name: Install dinginessentail-1.0-1
dnf:
name: dinginessentail-1.0-1
state: present
state: installed
register: dnf_result
- name: Check dinginessentail with rpm