mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
This commit is contained in:
parent
85d8587cc0
commit
3df62f1d8a
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue