diff --git a/lib/ansible/modules/packaging/os/pkg5.py b/lib/ansible/modules/packaging/os/pkg5.py index 0aa3b4d836a..2cb2eba96f0 100644 --- a/lib/ansible/modules/packaging/os/pkg5.py +++ b/lib/ansible/modules/packaging/os/pkg5.py @@ -128,7 +128,9 @@ def ensure(module, state, packages, params): 'subcommand': 'install', }, 'latest': { - 'filter': lambda p: not is_latest(module, p), + 'filter': lambda p: ( + not is_installed(module, p) or not is_latest(module, p) + ), 'subcommand': 'install', }, 'absent': {