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 0000000000..ae44616e79 --- /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 3f90365bb3..03b87e78f0 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