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
Add a better 'upgrade' UX ansible-galaxy #181
Comments
\CC @shertel @samdoran (since we talked about this just last week). |
I think that it's reasonable to expect |
FWIW we already have a feature request for |
I disagree with that, as outlined by @geerlingguy in ansible/ansible#65699 (comment) I also think that I also don't think that
Ie if the collection is already installed and I install it again nothing changes. In this case adding
In this case I want it to update, I explicitly told it which version I want. Also In the end I think a somewhat natural behaviour would be the following:
I think this matches mostly matches the behaviour of As @abadger mentioned, roles are somewhat of a different beast, so I'll happily leave them out of the discussion and accept the existing behaviour there. I do not think that adding a new command ala I'll try to make it to the meetings next week if you think the discussion has some merit. If you shoot it down by then I'll also accept that, but it would be great if we could collect more points on the ticket here since IRC is somewhat hard for longer texts ;) |
See also #7 - I don't think the landscape has really improved in the four years since I wrote that one. |
I agree with the UX you propose so I probably stated this bullet point badly. What I want to avoid is having to specify
+1. No need for prompting; everything is unambiguous with this UX. |
It does make sense. For example, in pip, it'd know to upgrade the dependencies instead of not touching them (even though the requested installable is satisfied). |
I have read comments in a few threads and I have not been able to understand why the install command has different behavior for collections and roles. You can upgrade collections just fine, but roles have to be force reinstalled every time to upgrade, which is not an ideal for obvious reasons. |
collections have a defined and required versioning specification, roles do not, so it is possible to reliably handle collections but not roles. |
Proposal: Simplification of galaxy installation workflows
Author: Florian Apolloner @apollo13
Date: 2020-07-01
Motivation
With the introduction of collections and the split in ansible 2.10 collections are probably becoming more and more coming. Yet the workflow with
ansible-galaxy
seems to be bolted on and leaves a bit to be desired.Problems
ansible-galaxy
currently does not allow updates of roles that are already installed. The following error is shown after updatingrequirements.yml
to a new version of a collection:This is suboptimal for multiple reasons:
ansible-galaxy
is probably the only package manager doing that.dnf/yum/apt/etc
ask if you want to update andpip
for instance will simply install the updated (or downgraded) version. Please note that thepip
behaviour does make sense to me. After all the user showed intent when executingansible-galaxy install -r requirements.yml
.ansible-galaxy install
every time they update a playbook from git etc (one could add that as post-checkout hooks). Telling them to execute it with--force
every time makes it a somewhat useless flag.ansible-galaxy
did not do what it was asked to do), I think the UX of that is horrible.Solution Proposal
I recommend automatically updating collections/roles to the requested version and or using a question
Do you want to update X->Z Y/N
like other package managers with a-y/--yes/--asume-yes
flag to automatically do so.The text was updated successfully, but these errors were encountered: