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".
This adds system_baseline_skip_upgrade_during_vzdump (bool, default false). With true and system_baseline_system_type: pve, tasks/update.yml runs pvesh get /nodes/localhost/tasks --source active --limit 0 before the upgrade. A vzdump task without an endtime skips the upgrade, and a message says why. Autoremove, autoclean and the reboot check still run, and the role does not wait for the backup.
The command task has check_mode: false and changed_when: false. In the main flow's check mode it is skipped together with the upgrade; the update entry point (which previews the upgrade) asks.
The answer must be a JSON list, otherwise the run stops instead of upgrading on a guess.
__system_baseline_vzdump_running is set on every run, so a guard that is off never inherits an earlier answer.
With the default no pvesh command runs. The role adds one set_fact and one skipped debug to the task list.
argument_specs (the update entry point mentions it too), README (table, a section "Skipping the upgrade during a backup", the Tests list) and a minor_changes fragment.
Decisions beyond the issue, which you may want to look at:
--source active.pvesh lists only finished tasks by default (source defaults to archive), so without it a running backup is not in the answer. I read the default with pvesh usage on a Proxmox node.
localhost as the node. It is the node's own alias in the Proxmox API, so no node name and no gathered facts are needed (the update entry point may run without them). I ran the call on a node; if you prefer the real node name, it is one string.
One code path. The update entry point gets the guard too, as proposed in the issue. It is off unless a caller sets the input.
The seven scenario cases (running vzdump, running next to another task, finished vzdump, other task only, empty list, input off, ubuntu_lxc) pass on a Debian host with ansible-core 2.22.0, against this branch, with a pvesh stub. Breaking the endtime test makes them fail.
On a Proxmox node, read-only: pvesh usage /nodes/{node}/tasks shows --source (default archive) and --limit (0 to N); pvesh get /nodes/localhost/tasks --source active --limit 0 --output-format json answers [] with no backup running, and --source all lists finished vzdump tasks with an endtime.
An independent read-only review found the missing --source, a test that would have failed the check and idempotence steps (moved to verify.yml), a misplaced spec bullet and a line over 160 characters; all are fixed in this commit.
Not verified
A running backup: I have not seen --source active list a running vzdump task without an endtime (nothing was running); the guard relies on that.
Molecule: it runs only in CI. The verify.yml play is the first run of the cases there.
That the apt task itself is skipped: the cases assert the fact that decides it and the pvesh call, not the task result.
No Proxmox image exists in CI (open issue about a Debian 13 image), so the stub stands for the real answer.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none. (None.)
Assisted-by: Claude Code:claude-sonnet-5-5
## What and why
Closes #400
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".
This adds `system_baseline_skip_upgrade_during_vzdump` (bool, default `false`). With `true` and `system_baseline_system_type: pve`, `tasks/update.yml` runs `pvesh get /nodes/localhost/tasks --source active --limit 0` before the upgrade. A `vzdump` task without an `endtime` skips the upgrade, and a message says why. Autoremove, autoclean and the reboot check still run, and the role does not wait for the backup.
- The command task has `check_mode: false` and `changed_when: false`. In the main flow's check mode it is skipped together with the upgrade; the `update` entry point (which previews the upgrade) asks.
- The answer must be a JSON list, otherwise the run stops instead of upgrading on a guess.
- `__system_baseline_vzdump_running` is set on every run, so a guard that is off never inherits an earlier answer.
- With the default no `pvesh` command runs. The role adds one `set_fact` and one skipped `debug` to the task list.
- argument_specs (the `update` entry point mentions it too), README (table, a section "Skipping the upgrade during a backup", the Tests list) and a `minor_changes` fragment.
Decisions beyond the issue, which you may want to look at:
- **`--source active`.** `pvesh` lists only finished tasks by default (`source` defaults to `archive`), so without it a running backup is not in the answer. I read the default with `pvesh usage` on a Proxmox node.
- **`localhost` as the node.** It is the node's own alias in the Proxmox API, so no node name and no gathered facts are needed (the `update` entry point may run without them). I ran the call on a node; if you prefer the real node name, it is one string.
- **One code path.** The `update` entry point gets the guard too, as proposed in the issue. It is off unless a caller sets the input.
## Verified
- All commit-stage hooks passed (ansible-lint, yamllint, changelog fragments lint, REUSE, Conventional Commit, `Assisted-by`).
- The seven scenario cases (running vzdump, running next to another task, finished vzdump, other task only, empty list, input off, `ubuntu_lxc`) pass on a Debian host with ansible-core 2.22.0, against this branch, with a `pvesh` stub. Breaking the `endtime` test makes them fail.
- On a Proxmox node, read-only: `pvesh usage /nodes/{node}/tasks` shows `--source` (default `archive`) and `--limit` (0 to N); `pvesh get /nodes/localhost/tasks --source active --limit 0 --output-format json` answers `[]` with no backup running, and `--source all` lists finished `vzdump` tasks with an `endtime`.
- An independent read-only review found the missing `--source`, a test that would have failed the `check` and `idempotence` steps (moved to `verify.yml`), a misplaced spec bullet and a line over 160 characters; all are fixed in this commit.
## Not verified
- A running backup: I have not seen `--source active` list a running `vzdump` task without an `endtime` (nothing was running); the guard relies on that.
- Molecule: it runs only in CI. The `verify.yml` play is the first run of the cases there.
- That the apt task itself is skipped: the cases assert the fact that decides it and the `pvesh` call, not the task result.
- No Proxmox image exists in CI (open issue about a Debian 13 image), so the stub stands for the real answer.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. (None.)
Assisted-by: Claude Code:claude-sonnet-5-5
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #400
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".
This adds
system_baseline_skip_upgrade_during_vzdump(bool, defaultfalse). Withtrueandsystem_baseline_system_type: pve,tasks/update.ymlrunspvesh get /nodes/localhost/tasks --source active --limit 0before the upgrade. Avzdumptask without anendtimeskips the upgrade, and a message says why. Autoremove, autoclean and the reboot check still run, and the role does not wait for the backup.check_mode: falseandchanged_when: false. In the main flow's check mode it is skipped together with the upgrade; theupdateentry point (which previews the upgrade) asks.__system_baseline_vzdump_runningis set on every run, so a guard that is off never inherits an earlier answer.pveshcommand runs. The role adds oneset_factand one skippeddebugto the task list.updateentry point mentions it too), README (table, a section "Skipping the upgrade during a backup", the Tests list) and aminor_changesfragment.Decisions beyond the issue, which you may want to look at:
--source active.pveshlists only finished tasks by default (sourcedefaults toarchive), so without it a running backup is not in the answer. I read the default withpvesh usageon a Proxmox node.localhostas the node. It is the node's own alias in the Proxmox API, so no node name and no gathered facts are needed (theupdateentry point may run without them). I ran the call on a node; if you prefer the real node name, it is one string.updateentry point gets the guard too, as proposed in the issue. It is off unless a caller sets the input.Verified
Assisted-by).ubuntu_lxc) pass on a Debian host with ansible-core 2.22.0, against this branch, with apveshstub. Breaking theendtimetest makes them fail.pvesh usage /nodes/{node}/tasksshows--source(defaultarchive) and--limit(0 to N);pvesh get /nodes/localhost/tasks --source active --limit 0 --output-format jsonanswers[]with no backup running, and--source alllists finishedvzdumptasks with anendtime.--source, a test that would have failed thecheckandidempotencesteps (moved toverify.yml), a misplaced spec bullet and a line over 160 characters; all are fixed in this commit.Not verified
--source activelist a runningvzdumptask without anendtime(nothing was running); the guard relies on that.verify.ymlplay is the first run of the cases there.pveshcall, not the task result.NOTICEandREUSE.toml, or there is none. (None.)Assisted-by: Claude Code:claude-sonnet-5-5