community.general.sysupgrade – Manage OpenBSD system upgrades

Note

This plugin is part of the community.general collection (version 3.8.3).

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.sysupgrade.

New in version 1.1.0: of community.general

Synopsis

  • Manage OpenBSD system upgrades using sysupgrade.

Parameters

Parameter

Comments

fetch_only

boolean

Fetch and verify files and create /bsd.upgrade but do not reboot.

Set to false if you want sysupgrade to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples.

Choices:

  • no

  • yes ← (default)

force

boolean

Force upgrade (for snapshots only).

Choices:

  • no ← (default)

  • yes

installurl

string

OpenBSD mirror top-level URL for fetching an upgrade.

By default, the mirror URL is pulled from /etc/installurl.

keep_files

boolean

Keep the files under /home/_sysupgrade.

By default, the files will be deleted after the upgrade.

Choices:

  • no ← (default)

  • yes

snapshot

boolean

Apply the latest snapshot.

Otherwise release will be applied.

Choices:

  • no ← (default)

  • yes

Examples

- name: Upgrade to latest release
  community.general.sysupgrade:
  register: sysupgrade

- name: Upgrade to latest snapshot
  community.general.sysupgrade:
    snapshot: yes
    installurl: https://cloudflare.cdn.openbsd.org/pub/OpenBSD
  register: sysupgrade

- name: Reboot to apply upgrade if needed
  ansible.builtin.reboot:
  when: sysupgrade.changed

# Note: Ansible will error when running this way due to how
#   the reboot is forcefully handled by sysupgrade:

- name: Have sysupgrade automatically reboot
  community.general.sysupgrade:
    fetch_only: no
  ignore_errors: yes

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

stderr

string

Sysupgrade standard error.

Returned: always

Sample: “sysupgrade: need root privileges”

stdout

string

Sysupgrade standard output.

Returned: always

Authors

  • Andrew Klaus (@precurse)