大网数据广告活动
服务器运维问答

How to upgrade snap packages using Ansible?

· 52CE 我爱测

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 web…

问题原文

原帖链接 · 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:

There seems to be no option to upgrade snap package using ansible

A GitHub issue has been created.

Workaround

  1. 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
    
  2. run ansible again

  3. 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.

snapcraft.io Getting Started

It should be possible to update a single package using the command module:

- name: Update snap package
  command: snap refresh package_name

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。