From abde33c615807dc07575177b79cb7a8196f53b48 Mon Sep 17 00:00:00 2001 From: Conrado Buhrer Date: Mon, 26 Jan 2015 18:16:42 -0200 Subject: [PATCH] fixed: erroneous logic --- lib/ansible/modules/packaging/os/apt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index 93809602afa..90d1716e2ca 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -607,8 +607,12 @@ def main(): module.fail_json(msg='version number inconsistent with state=latest: %s' % package) if p['state'] in ('latest', 'present', 'build-dep'): - build_dep = p.get('build-dep', False) - upgrade = p.get('latest', False) + upgrade = False + build_dep = False + if p['state'] == 'latest': + upgrade = True + if p['state'] == 'build-dep': + build_dep = True result = install(module, packages, cache, upgrade=upgrade, default_release=p['default_release'], install_recommends=install_recommends,