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
[PR #2411/345d5f2d backport][stable-3] snap - revamp + implementing enabled/disabled states #2542
[PR #2411/345d5f2d backport][stable-3] snap - revamp + implementing enabled/disabled states #2542
Conversation
* revamp of snap module * added changelog fragment * fixed description * Update changelogs/fragments/2411-snap-revamp-enabled-disabled-states.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 345d5f2)
@russoz @aminvakil did one of you happen to run some tests for #2411 (resp. this PR)? There are unfortunately no tests for this module... |
Not really, but I think I can come up with some tests for that module. |
@felixfontein no, I don't use |
@jkman340, since you seem to be using the snap module, would you mind to help testing this PR? You can find instructions on how that works here: https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst |
@felixfontein seems to be working here! I also have the problem in #2835. |
@staticdev thanks a lot for testing this :) It's not supposed to fix #2835 (resp. if it would, it would be coincidental), but at least now we can continue with the new codebase (which this backports also adds to stable-3). |
@staticdev thanks for testing! Valeu!! ;-) |
Sorry for delay, was on travel. I've tested the latest stable-3 and see no additional errors. However, #2835 is not fixed for me and still getting same error (Which sounds like is expected for this PR). |
@jkman340 thanks for testig! I hope you travelled well :) |
@russoz I just did some new tests with the newly released 3.3.0 and I am getting a new error in my workstation: - name: Install pycharm
community.general.snap:
name: "pycharm-professional"
classic: true
become: true snap is installed and running and same task work on previous version. Output with -vvv:
|
@staticdev Just to keep all the conversations in one place, is your issue same as #2906 ? |
FYI: the version of the module in 3.3.0 is identical to the version in this PR. |
Exactly @aminvakil.. and yes, I am sorry @felixfontein, but my initial tests were obviously flawed =/ |
@staticdev No worries, man. Thanks for your time on it. Any way, Felix has put up a neat set of automated tests in place, so it should be easier to test (and to add more tests) the next time! Thanks for your support! 👍 |
The tests are based on work by @aminvakil, it unfortunately turned out that snap doesn't work inside docker (not even for just installing/uninstalling snaps) so I had to spend a bit more work to make them run on the RHEL VMs we have in CI :) |
@felixfontein this problem to run on docker I am having for quite some time now, even before this PR. I thought it was related to #2835, but seems not. I have a molecule scenario that works on a Debian 11 machine, but not on a Debian 11 image on docker (https://github.com/staticdev/ansible-role-python-developer). Scenario is this one: |
@staticdev |
@aminvakil this is strange, I even saw some specific Go code on their repo for docker support: https://github.com/snapcore/snapd/search?q=docker |
@staticdev Apparently snap can interact with docker, but not run from within a container. See: |
This is a backport of PR #2411 as merged into main (345d5f2).
SUMMARY
Adding the states
enabled
anddisabled
, and while at it, did a major revamp of the module.Fixes #1990
ISSUE TYPE
COMPONENT NAME
plugins/modules/packaging/os/snap.py