-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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 snap module #44939
Add snap module #44939
Conversation
First, thanks to Victor Carceler for the base module. * All sanity tests are now successful * Improved module doc * Removed a lot of code and comments that were just a copy/paste from the ansible doc: https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#new*module*development Most of it was uneeded. Some just broked the code. * Refactored the code: * It's easier to read and understand * It's shorter * functions make more sense * Some bugs have been fixed, like the output on exit_json and fail_json
@AnderEnder @DJMuggs @JoergFiedler @KimNorgaard @L2G @albertomurillo @alxgu @andrew-d @andytom @barnabycourt @berenddeboer @berenddeschouwer @brian-brazil @brontitall @danieljaouen @dermute @dinoocch @eest @enriclluelles @evgkrsk @FlossWare @giovannisciortino @hacosta @ignatenkobrain @indrajitr @jasperla @JayKayy @jcftang @jirutka @jtyr @jvantuyl @kahowell @kustodian @matze @mavit @melodous @mgwilliams @oolongbrothers @pmakowski @robinro @sashka @scathatheworm @skinp @sysadmind @szinck @tdtrask @the-maldridge @troy2914 @vaygr @verm666 @vincentvdk @vritant @wltjr As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
This comment has been minimized.
This comment has been minimized.
@angristan This PR contains |
|
Ah.. right. Should be fixed now. |
Indeed 👍 I'm encountering a weird bug right now...
On the server:
|
Unless the |
Oh, it probably needs wrapping with |
test now |
oooh ok, since It's working now 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @angristan!
Thank you very, very much! It was a great experience and I appreciate you taking the time (and having the patience) to help a beginner. 🙇 |
@angristan you are welcome :) P.S. Feel free to send follow-up PRs adding regression tests. Here's some example of how it's done for other modules https://github.com/ansible/ansible/blob/devel/test/integration/targets/apt. Essentially it's just playbooks running the module and then asserting results. Seek more info in docs :) |
OK, I will try to do that! |
As someone looking in from the outside a bit, I'm quite excited to see this. When is this expected to hit a stable ansible release, and is there any way of using it sooner without wholesale installing ansible from git? |
@benyanke wait for 2.8 or copy-paste this module into a |
I'm trying this out and it's working well overall, but it fails on snap install hooks the first time, then succeeds if run again. Should I document here or make a new issue? |
Thanks for reporting @benyanke, since the module is still on |
@benyanke in general it's better to open new issues and PRs, because closed/merged things don't get much attention and get lost. Rule of thumb 👍: create one separate issue or/and PR per problem/request. Also, @angristan has power to +1 PRs sent against this module in case you'll decide to send a patch. |
Let's follow @webknjaz's advices 😄 |
Sounds good to me. Will open a new ticket (and reference this one) when I have a chance to replicate it |
Something that would be cool for this module would be if it had something like Thanks for the module. I am now using it with Ansible 2.7.1 as pointed out above. |
PR ansible#44939 Fixes ansible#39155 Closes ansible#40852 Co-authored-by: Victor Carceler <vcarceler@iespuigcastellar.xeill.net> Co-authored-by: Stanislas Lange <angristan@pm.me> Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
SUMMARY
This PR adds the snap module to manage snaps packages (see snapcraft.io).
Features:
It is based on the PR #40852 and the work made by @vcarceler. (Thanks a bunch!)
His branch runs against a number of issues against the CI and he has not made any update in 3 months, so I'm finishing the work. In the end, I did a bit of refactoring 😄
This fixes issue #39155.
exit_json
andfail_json
I would like to implement more features like
snap refresh
, but sadly I don't think this is feasible in a clean way for now, considering how the cli works.Any feedback is welcome! I'm new to this.
ISSUE TYPE
COMPONENT NAME
More specifically:
ANSIBLE VERSION