From 3df62f1d8aa5dcc9e955b189dc5258d666d0c822 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 5 Dec 2013 17:55:05 +0100 Subject: [PATCH] Fix apt module to be able to install package by giving just a provides and not the full name The apt module check if a packag eis valid by loking in the cache, checking only for full name, while it should also check that the name is not just provided. Fix https://github.com/ansible/ansible/issues/5177 --- library/packaging/apt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/packaging/apt b/library/packaging/apt index 829a689fc2..e6bfa6d468 100644 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -169,6 +169,8 @@ def package_status(m, pkgname, version, cache, state): ll_pkg = cache._cache[pkgname] # the low-level package object except KeyError: if state == 'install': + if cache.get_providing_packages(pkgname): + return False, True, False m.fail_json(msg="No package matching '%s' is available" % pkgname) else: return False, False, False