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/packaging/os/opkg.py b/plugins/modules/packaging/os/opkg.py index 60d2adc958..6c5e23093e 100644 --- a/plugins/modules/packaging/os/opkg.py +++ b/plugins/modules/packaging/os/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))