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/。 选项
|
|
要安装或删除的覆盖包的名称。 |
|
覆盖包的状态。
选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:不支持 |
可以在 |
|
支持:不支持 |
在差异模式下,将返回有关已更改内容(或可能需要在 |
示例
- 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 命令的标准输出。 返回:始终 示例: |