From 00552987f71041ce7e84f909f436a9f242a8ad22 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 21 Apr 2024 15:08:18 +0200 Subject: [PATCH] Fix package install check. --- changelogs/fragments/8263-apt_rpm-install-check.yml | 2 ++ plugins/modules/apt_rpm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/8263-apt_rpm-install-check.yml diff --git a/changelogs/fragments/8263-apt_rpm-install-check.yml b/changelogs/fragments/8263-apt_rpm-install-check.yml new file mode 100644 index 00000000000..ae44616e79f --- /dev/null +++ b/changelogs/fragments/8263-apt_rpm-install-check.yml @@ -0,0 +1,2 @@ +bugfixes: + - "apt_rpm - when checking whether packages were installed after running ``apt-get -y install ``, only the last package name was checked (https://github.com/ansible-collections/community.general/pull/8263)." diff --git a/plugins/modules/apt_rpm.py b/plugins/modules/apt_rpm.py index 3f90365bb37..03b87e78f09 100644 --- a/plugins/modules/apt_rpm.py +++ b/plugins/modules/apt_rpm.py @@ -281,7 +281,7 @@ def install_packages(module, pkgspec, allow_upgrade=False): rc, out, err = module.run_command("%s -y install %s" % (APT_PATH, packages), environ_update={"LANG": "C"}) installed = True - for packages in pkgspec: + for package in pkgspec: if not query_package_provides(module, package, allow_upgrade=False): installed = False