From 2363074dd825e7c8e1cb29d068ff8fdca7d5146f Mon Sep 17 00:00:00 2001 From: Henry Finucane Date: Fri, 14 Nov 2014 16:27:20 -0800 Subject: [PATCH] If force=true, ignore python-apt's advice This lets you downgrade packages, for instance. --- 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 5c557900b76..c18661d19df 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -333,7 +333,7 @@ def install_deb(m, debs, cache, force, install_recommends, dpkg_options): if pkg.compare_to_version_in_cache() == pkg.VERSION_SAME: continue # Check if package is installable - if not pkg.check(): + if not pkg.check() and not force: m.fail_json(msg=pkg._failure_string) # add any missing deps to the list of deps we need