From 1b94aa2d437a356c57600afa76ce346527b3ffa9 Mon Sep 17 00:00:00 2001 From: NielsH Date: Mon, 18 Apr 2016 17:14:57 +0200 Subject: [PATCH] Resolve idempotency issue with virtual apt package (#3449) Virtual packages were always marked as upgradable which caused the changed-state even though nothing changed. --- lib/ansible/modules/packaging/os/apt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index 7f1f7b65882..1959477f2d0 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -269,7 +269,7 @@ def package_status(m, pkgname, version, cache, state): installed, upgradable, has_files = package_status(m, package.name, version, cache, state='install') if installed: is_installed = True - return is_installed, True, False + return is_installed, upgradable, False m.fail_json(msg="No package matching '%s' is available" % pkgname) except AttributeError: # python-apt version too old to detect virtual packages