feat(system_baseline): optionally skip the upgrade while a vzdump backup is running
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:
1 parent
1afce962a0
commit
5519733312
7 files changed
+170
-1
No files matched your search
@@ -395,3 +395,22 @@
|
||||
- system_baseline_verify_blacklist_dump_removed.stdout_lines | select('match', 'Unattended-Upgrade::Package-Blacklist::\s') | list == []
|
||||
quiet: true
|
||||
tags: always
|
||||
|
||||
# The vzdump guard (system_baseline_skip_upgrade_during_vzdump): a running backup is a vzdump task without an endtime. With the input off, or on
|
||||
# a system type other than pve, pvesh is never run. Only the decision is asserted: the upgrade itself is not run in CI.
|
||||
- name: The vzdump guard skips the upgrade only for a running backup on a pve node
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Run each case
|
||||
ansible.builtin.include_tasks: tasks/vzdump_guard_case.yml
|
||||
vars:
|
||||
system_baseline_case: "{{ item }}"
|
||||
loop:
|
||||
- {type: pve, input: true, running: true, asked: true, answer: [{type: vzdump, upid: a, starttime: 1}]}
|
||||
- {type: pve, input: true, running: true, asked: true, answer: [{type: vzdump, upid: a, starttime: 1}, {type: qmstart, upid: b, starttime: 1}]}
|
||||
- {type: pve, input: true, running: false, asked: true, answer: [{type: vzdump, upid: a, starttime: 1, endtime: 2}]}
|
||||
- {type: pve, input: true, running: false, asked: true, answer: [{type: qmstart, upid: b, starttime: 1}]}
|
||||
- {type: pve, input: true, running: false, asked: true, answer: []}
|
||||
- {type: pve, input: false, running: false, asked: false, answer: [{type: vzdump, upid: a, starttime: 1}]}
|
||||
- {type: ubuntu_lxc, input: true, running: false, asked: false, answer: [{type: vzdump, upid: a, starttime: 1}]}
|
||||
Reference in new issue
Block a user