问题原文
原帖链接 · 030 · CC BY-SA 4.0
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 removedrun 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?
已采纳解答
原帖链接 · Henrik Pingel · CC BY-SA 4.0
I guess this functionality hasn't been implemented in the module because:
Updates are automatically installed within 6 hours of a revision being made to a tracked channel, keeping most systems up-to-date. This schedule can be tuned via configuration options.
It should be possible to update a single package using the command module:
- name: Update snap package
command: snap refresh package_name
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
