From 2b39470a774c28e26780e4e2e4cc9b998471da3c Mon Sep 17 00:00:00 2001 From: joergho <48011876+joergho@users.noreply.github.com> Date: Mon, 19 Dec 2022 20:23:44 +0100 Subject: [PATCH] opkg: fix issue that force=reinstall would not reinstall an existing package (#5705) * opkg: fix issue that force=reinstall would not reinstall an existing package Signed-off-by: Joerg Hofrichter * changelog fragment Signed-off-by: Joerg Hofrichter --- changelogs/fragments/5705-opkg-fix-force-reinstall.yml | 2 ++ plugins/modules/opkg.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5705-opkg-fix-force-reinstall.yml diff --git a/changelogs/fragments/5705-opkg-fix-force-reinstall.yml b/changelogs/fragments/5705-opkg-fix-force-reinstall.yml new file mode 100644 index 0000000000..27a188ab9e --- /dev/null +++ b/changelogs/fragments/5705-opkg-fix-force-reinstall.yml @@ -0,0 +1,2 @@ +bugfixes: + - opkg - fix issue that ``force=reinstall`` would not reinstall an existing package (https://github.com/ansible-collections/community.general/pull/5705). diff --git a/plugins/modules/opkg.py b/plugins/modules/opkg.py index 60d2adc958..6c5e23093e 100644 --- a/plugins/modules/opkg.py +++ b/plugins/modules/opkg.py @@ -154,7 +154,7 @@ def install_packages(module, opkg_path, packages): install_c = 0 for package in packages: - if query_package(module, opkg_path, package): + if query_package(module, opkg_path, package) and (force != '--force-reinstall'): continue rc, out, err = module.run_command("%s install %s %s" % (opkg_path, force, package))