New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zypper fails to install with specified version #4371
Comments
Files identified in the description: If these files are incorrect, please update the |
The problem seems to be rooted in the method package_present(m, name, want_latest):
If no packages without version are requested packageswithoutversion will be empty. But the method get_installed_state() returns the state of ALL installed packages, when called with an empty package list. This, I believe, results in an exessive filter list prerun_state which essentially removes all packages that are installed in any version on the target system from the request list. This completely blocks the update/downgrade path of any installed package (unless you always specify one aditional "dummy" package as a workaround) Something like this would fix the problem:
Of course one could also change the behaviour of get_installed_state() when called with an empty packagelist. My appologies, if I got this totaly wrong. I don't speak python really ;-). |
Fixed in #4421. |
Summary
If a package is already installed on the target system, the zypper module fails to install a specified different version, claiming it's already there.
Issue Type
Bug Report
Component Name
zypper
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Steps to Reproduce
The following task ALWAYS reports [ok] if any version of a-very-important-package is already installed on the target system.
As soon as at least one other package WITHOUT a version specification is requestet, everything works as expected.
Expected Results
specific package version gets installed/updated/downgraded
Actual Results
specific package version is reported as present even if it is not in the requested version
Code of Conduct
The text was updated successfully, but these errors were encountered: