feat(system_baseline): optionally skip the upgrade while a vzdump backup is running
Build / build (pull_request) Successful in 42s
Lint / lint (pull_request) Successful in 2m48s
Molecule / molecule (pull_request) Successful in 15m25s

An apt upgrade of a Proxmox node can restart Proxmox services while a
backup holds a snapshot of a guest, and the role had no way to say
"not now".

system_baseline_skip_upgrade_during_vzdump (bool, default false) makes
the main flow and the update entry point ask the node for its running
tasks (pvesh get /nodes/localhost/tasks --source active) before the
upgrade, on the pve system type only. A vzdump task without an end time
skips the upgrade with a message; autoremove, autoclean and the reboot
check still run. The role does not wait for the backup. A pvesh answer
that is not a JSON list stops the run. With the default no pvesh
command runs.

Closes #400

Assisted-by: Claude Code:claude-sonnet-5-5
This commit is contained in:
Dragonish committed 2026-11-26 22:49:33 +00:00
1 parent 1afce962a0
commit 5519733312
7 files changed
+170 -1

No files matched your search

@@ -162,6 +162,18 @@ argument_specs:
the reboot.
- The C(update) entry point does not read it.
- In check mode the main flow skips the upgrade itself (a pending update is not drift); autoremove and autoclean are still checked.
system_baseline_skip_upgrade_during_vzdump:
type: bool
default: false
description:
- >-
Skip the apt upgrade while a vzdump backup is running on the Proxmox node. Acts only when C(system_baseline_system_type) is
C(pve): the role runs C(pvesh get /nodes/localhost/tasks --source active), and a C(vzdump) task in that list is a running backup.
The upgrade is then skipped with a message, and the rest of the flow (autoremove, the reboot check) goes on. It does not wait for
the backup. With false, or on any other system type, no C(pvesh) command runs.
- >-
The C(update) entry point reads it too, and a C(pvesh) answer that is not a JSON list fails the run instead of upgrading. In check mode the
main flow skips the upgrade itself, so it does not ask for the tasks.
update:
short_description: Update and upgrade apt packages
description:
@@ -176,6 +188,9 @@ argument_specs:
It creates C(system_baseline_apt_tmpdir), runs the upgrade and the autoremove with C(TMPDIR) set to it, and then opens a new
connection, so that a restart of C(ssh.service) during the upgrade does not remove the files apt needs. It reads that input
although the entry point has no argument specification of its own.
- >-
It also reads C(system_baseline_skip_upgrade_during_vzdump): with true on C(system_baseline_system_type) C(pve) it skips the upgrade while
a vzdump backup is running.
reboot:
short_description: Compute system_baseline_reboot_required and reboot when allowed
description: