community.general.syspatch 模块 – 管理 OpenBSD 系统补丁
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install community.general。
要在剧本中使用它,请指定: community.general.syspatch。
概要
- 使用 syspatch 管理 OpenBSD 系统补丁。 
参数
| 参数 | 注释 | 
|---|---|
| 回滚系统补丁。 选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在  | |
| 支持:不支持 | 在差异模式下,将返回有关已更改内容(或可能需要在  | 
示例
- name: Apply all available system patches
  community.general.syspatch:
- name: Revert last patch
  community.general.syspatch:
    revert: one
- name: Revert all patches
  community.general.syspatch:
    revert: all
# NOTE: You can reboot automatically if a patch requires it:
- name: Apply all patches and store result
  community.general.syspatch:
  register: syspatch
- name: Reboot if patch requires it
  ansible.builtin.reboot:
  when: syspatch.reboot_needed
返回值
常见的返回值已在 此处 记录,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 命令返回码 (0 表示成功) 返回:始终返回 | |
| 更新后是否需要重新启动。 返回:始终返回 示例: | |
| syspatch 标准错误。 返回:始终返回 示例: | |
| syspatch 标准输出。 返回:始终返回 示例: | 
