The aim is to upgrade snap packages, e.g. n3dr and informado, using Ansible. The following task has been created:
- name: Install various snap packages
snap:
name:
- informado
- n3dr
Attempts to solve the issue
The following websites were consulted:
- https://docs.ansible.com/ansible/latest/modules/snap_module.html
- https://github.com/ansible/ansible/issues/62492
- https://github.com/ansible-collections/community.general/blob/main/plugins/modules/packaging/os/snap.py
There seems to be no option to upgrade snap package using ansible
A GitHub issue has been created.
Workaround
remove the to be updated packages
user@host:~$ sudo snap remove informado n3dr 2020-07-15T10:21:18+02:00 INFO Waiting for conflicting change in progress... informado removed n3dr removed
run ansible again
the newest version of the n3dr and informado have been installed
Question
How to upgrade snap packages without removing them first, using ansible?
I guess this functionality hasn't been implemented in the module because:
snapcraft.io Getting Started
It should be possible to update a single package using the command module: