-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Snap module does not change channel if the snap is already installed #1606
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Files identified in the description: If these files are inaccurate, please update the |
@sean-abbott |
I'm having the same problem, current snap CLI can do this via:
|
Files identified in the description: If these files are incorrect, please update the |
@russoz I'm having the same issue. As mentioned by strk, this is implemented by |
hi @alirezaghey your message got me thinking of this problem and it itched up to the point where I decided to do some work on it. The PR I created makes changes to the code so that the snap module is now able to recognize that an installed snap from one channel is not equal to a snap being installed from a different channel. |
Now the problem is, what to do with that? :-)
What you folks think? BTW, after this PR I am planning on doing a big refactor on the module - should not affect its outcome, and create a snap_info module to read the installed snaps. |
hey @russoz, that's a nice addition! IMO, it would be best to stay as close as possible to the
We would need to look into how snap reacts to This would keep working with the module easier. But again, I'm not very familiar with Ansible and its conventions, and it could be that staying this close to how the original tool behaves isn't part of the philosophy. |
hi @alirezaghey that sounds like option 3 up there. I like it too, but let's give a bit of time for others to take a look. |
Hi @alirezaghey I have worked on it this weekend and I've been thinking that it would make more sense, in the spirit of ansible's idempotency, to have the module automatically detect whether a refresh is needed or not and act accordingly. I have just updated the PR with that, and I have added a test case to demonstrate. The CI is still running but it looks good (it tested ok locally). |
SUMMARY
I'm attempting to set the snap channel with ansible on already installed machines, but "tracking" channel (which happens to currently co-incide with the version I'm tracking to track) remains pointed at latest/stable
ISSUE TYPE
COMPONENT NAME
snap
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
I expect the tracking channel of the microk8s snap
ACTUAL RESULTS
The tracking channel for the microk8s snap remains set to latest/stable
The text was updated successfully, but these errors were encountered: