-
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 fails with state absent on snap that is not installed #2835
Comments
Same as this closed issue #1433 but does not work for me. Confirmed snapd is running on remote system. |
!component =plugins/modules/packaging/os/snap.py |
Taking a quick look at code it seems that it fails here:
which calls here: community.general/plugins/modules/packaging/os/snap.py Lines 189 to 193 in 1ed4394
which checks this: community.general/plugins/modules/packaging/os/snap.py Lines 172 to 173 in 1ed4394
I guess it's fine to fail if package does not exist in snap repository, does snap return non-zero if package exists in snap repository but it isn't installed when executing snap info pkg ?
|
Please note that the snap module in the |
I think this is also fixed by #2912. |
* Try some snap fixes. * Fix logic. * Try to run tests privileged. * Prevent failure on rc != 0. * Fix formatting. * Revert "Try to run tests privileged." This reverts commit 77ca91f. * Try to run tests on RHEL instead. * Make sure that snapd is running. * Add changelog fragment. * str -> to_native. * Make sure that installed binary is actually found. * Add check mode tests. * Mention #2835 in changelog fragment.
* Try some snap fixes. * Fix logic. * Try to run tests privileged. * Prevent failure on rc != 0. * Fix formatting. * Revert "Try to run tests privileged." This reverts commit 77ca91f. * Try to run tests on RHEL instead. * Make sure that snapd is running. * Add changelog fragment. * str -> to_native. * Make sure that installed binary is actually found. * Add check mode tests. * Mention #2835 in changelog fragment. (cherry picked from commit c63dc62)
…) (#2915) * Try some snap fixes. * Fix logic. * Try to run tests privileged. * Prevent failure on rc != 0. * Fix formatting. * Revert "Try to run tests privileged." This reverts commit 77ca91f. * Try to run tests on RHEL instead. * Make sure that snapd is running. * Add changelog fragment. * str -> to_native. * Make sure that installed binary is actually found. * Add check mode tests. * Mention #2835 in changelog fragment. (cherry picked from commit c63dc62) Co-authored-by: Felix Fontein <[email protected]>
Summary
Using snap module to ensure a snap is not installed on system. Task fails with error "No snap matching 'foo' available."
Issue Type
Bug Report
Component Name
community.general.snap
Ansible Version
ansible 2.10.5
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
ANSIBLE_PIPELINING(/etc/ansible/ansible.cfg) = True
OS / Environment
Ubuntu 18.04
Steps to Reproduce
Expected Results
Module to pass with OK (not changed)
Actual Results
Module fails with error above
Code of Conduct
The text was updated successfully, but these errors were encountered: