community.general.swupd 模块 – 管理 ClearLinux 系统中的更新和捆绑包

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在剧本中使用它,请指定:community.general.swupd

概要

  • 使用 swupd 捆绑包管理器管理更新和捆绑包,该管理器由英特尔架构的 Clear Linux 项目使用。

参数

参数

注释

contenturl

字符串

指向可用捆绑包内容的 URL。如果未指定,则从 clearlinux.org 检索内容。

format

字符串

版本文件下载的格式后缀。例如 [1,2,3,staging,etc]。如果未指定,则使用默认格式。

manifest

别名:release,version

整数

清单包含有关操作系统特定版本捆绑包的信息。指定清单版本以根据该版本进行验证,或者保留未指定以根据当前版本进行验证。

name

别名:bundle

字符串

要安装或删除的 (I) 捆绑包的名称。

state

字符串

指示所需的 (I) 捆绑包状态。present 确保安装了捆绑包,而 absent 确保未安装 (I) 捆绑包。

选项

  • "present" ←(默认)

  • "absent"

update

布尔值

将操作系统更新到最新版本。

选项

  • false ←(默认)

  • true

url

字符串

覆盖 contenturlversionurl

verify

布尔值

验证操作系统版本的内容。

选项

  • false ←(默认)

  • true

versionurl

字符串

版本字符串下载的 URL。

属性

属性

支持

描述

check_mode

支持: 完全

可以在 check_mode 中运行,并返回已更改状态预测,而无需修改目标。

diff_mode

支持:

在差异模式下运行时,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息。

示例

- name: Update the OS to the latest version
  community.general.swupd:
    update: true

- name: Installs the "foo" bundle
  community.general.swupd:
    name: foo
    state: present

- name: Removes the "foo" bundle
  community.general.swupd:
    name: foo
    state: absent

- name: Check integrity of filesystem
  community.general.swupd:
    verify: true

- name: Downgrade OS to release 12920
  community.general.swupd:
    verify: true
    manifest: 12920

返回值

常见返回值记录在此处 此处,以下是此模块特有的字段

描述

stderr

字符串

swupd 的 stderr

返回: 始终

stdout

字符串

swupd 的 stdout

返回: 始终

作者

  • Alberto Murillo (@albertomurillo)