community.general.rpm_ostree_pkg 模块 – 安装或卸载叠加的额外软件包
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您使用的是 ansible 软件包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.rpm_ostree_pkg。
community.general 2.0.0 中的新增功能
概要
- 使用 - rpm-ostree命令安装或卸载叠加的额外软件包。
参数
| 参数 | 注释 | 
|---|---|
| 当  当  有关更多信息,请参阅 https://coreos.github.io/rpm-ostree/apply-live/。 选择 
 | |
| 要安装或删除的叠加软件包的名称。 | |
| 叠加软件包的状态。 
 
 选择 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:无 | 可以在  | |
| 支持:无 | 当处于 diff 模式时,将返回有关已更改内容(或可能需要在  | 
示例
- name: Install overlay package
  community.general.rpm_ostree_pkg:
    name: nfs-utils
    state: present
- name: Remove overlay package
  community.general.rpm_ostree_pkg:
    name: nfs-utils
    state: absent
- name: Apply the overlay package live
  community.general.rpm_ostree:
    name: nfs-utils
    state: present
    apply_live: true
# In case a different transaction is currently running the module would fail.
# Adding a delay can help mitigate this problem:
- name: Install overlay package
  community.general.rpm_ostree_pkg:
    name: nfs-utils
    state: present
  register: rpm_ostree_pkg
  until: rpm_ostree_pkg is not failed
  retries: 10
  dealy: 30
返回值
常见的返回值记录在此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 执行的操作。 返回: 始终 示例:  | |
| 状态更改。 返回: 始终 示例:  | |
| 用于执行操作的完整命令。 返回: 始终 示例:  | |
| 确定机器是否需要重新启动以应用当前更改。 返回: 成功 示例:  | |
| 指定软件包的列表。 返回: 始终 示例:  | |
| rpm-ostree 命令的返回代码。 返回: 始终 示例:  | |
| rpm-ostree 命令的标准错误输出。 返回: 始终 示例:  | |
| rpm-ostree 命令的标准输出。 返回: 始终 示例:  | 
