community.general.syspatch module – Manage OpenBSD system patches

Note

This module is part of the community.general collection (version 9.4.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.syspatch.

Synopsis

  • Manage OpenBSD system patches using syspatch.

Parameters

Parameter

Comments

revert

string

Revert system patches.

Choices:

  • "all"

  • "one"

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- 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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

rc

integer

The command return code (0 means success)

Returned: always

reboot_needed

boolean

Whether or not a reboot is required after an update.

Returned: always

Sample: true

stderr

string

syspatch standard error.

Returned: always

Sample: "syspatch: need root privileges"

stdout

string

syspatch standard output.

Returned: always

Sample: "001_rip6cksum"

Authors

  • Andrew Klaus (@precurse)