-
Notifications
You must be signed in to change notification settings - Fork 30
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
Upgrade of package when State is Present and Version is specified, fails unless forced #59
Comments
This seems to be by design, at least going from the error message the code gives back here. Though at least from my perspective it seems a little odd to require a different state for upgrades vs fresh installs, when choco is usually perfectly able to upgrade packages... Maybe because this module also supports @jborean93 might be able to speak to the design intent here. |
The code around this snippet provides a bit more context https://github.com/chocolatey/chocolatey-ansible/blob/master/chocolatey/plugins/modules/win_chocolatey.ps1#L780-L794. This is only run when Maybe this could be amended by having the module implicitly upgrade it but how do decide what to update if there are multiple versions and Oh did I mention package management versioning is hard :) |
I don't think Chocolatey itself handles this eventuality well either, really, even if you did have --allow-multiple on the command, I doubt I'd be able to predict what Chocolatey would do in that kind of situation. It's probably part of the reason Rob tends to recommend against using side-by-side installations. I'm not sure there's a ton we can do to do better here, but maybe it'd be more intuitive for some folks if we simply added |
Agreeing with @vexx32 here. I think |
Tangentially related: chocolatey/choco#1022 If that issue goes somewhere in future we might end up with |
Added state: upgrade option to docs, clarified docs on version option a bit more, attempting to make it abundantly clear that using state: present with a specific target version can fail if the versions don't match up.
Duplicate some of our state: latest tests to use state: upgrade to ensure both state commands work the same way.
Added state: upgrade option to docs, clarified docs on version option a bit more, attempting to make it abundantly clear that using state: present with a specific target version can fail if the versions don't match up.
Duplicate some of our state: latest tests to use state: upgrade to ensure both state commands work the same way.
this and the docs confuse me, the way it reads it sounds like the behaviour is exactly the same as latest, but latests ignores the version correct? is upgrade constrained to the version? |
Neither That confusion is somewhat exactly why I dislike the name |
I think it is quite unintuitive that the combination |
Sure, it's possible. It would be a fairly significant breaking change in the module behaviour, though, and I don't really see the value in changing it to effectively do the same thing as another |
Offending code:
WORKAROUND:
The text was updated successfully, but these errors were encountered: