feat(system_baseline): run the apt upgrade as dist-upgrade on the pve profile #334

Merged
Dragonish merged 2 commits from feat/329-pve-dist-upgrade into main 2026-11-23 20:37:38 +00:00
Collaborator

What and why

Closes #329

New profile key apt_upgrade (safe or dist), resolved to system_baseline_apt_upgrade. The pve profile uses dist, so the update step runs apt-get dist-upgrade (the same as apt full-upgrade) on a Proxmox VE host; ubuntu_lxc and ubuntu_vm keep the plain upgrade. tasks/update.yml passes the input to the package module (safe is the module's name for the plain upgrade, apt-get upgrade --with-new-pkgs, which is what upgrade: true ran before). The value is validated (safe or dist, anything else stops the run with a message that names the input), and a consumer can set system_baseline_apt_upgrade or the profile key per host.

A correction to the issue text: it said a safe upgrade never installs a new package. The apt module's safe mode is upgrade --with-new-pkgs, which does install new dependencies. The real difference is that dist-upgrade can also remove packages an update replaces, which is what a safe upgrade holds back on Proxmox. The Proxmox VE documentation (System Software Updates) updates a node with apt full-upgrade and warns that apt upgrade "may result in a partially upgraded or broken package state", because full-upgrade "can also remove existing packages to satisfy dependencies". The README says it that way. The apt dist-upgrade wording in the example I added to the blacklist section in #325 is corrected here to apt full-upgrade.

Behaviour changes

  • A pve host that was upgraded with safe until now also gets the packages a safe upgrade held back (a new kernel, pve-manager and its dependencies) on the next run. That can restart Proxmox services, and a new kernel needs a reboot. system_baseline_reboot_if_required defaults to true, so the README tells a consumer to set it to false before applying the role to a hypervisor they want to reboot themselves. I did not change that default (the issue asks).
  • The update entry point, a supported interface, follows the same input and now checks it itself (it does not run validate.yml): with system_baseline_system_type: pve it now upgrades with dist. It does not require a system type, so without one it stays on safe (the derived input is guarded), and nothing fails for a caller that never sets one. Is following the profile the behaviour you want for the entry point?

Verified

  • The resolution, with Ansible's own engine, seven cases: pve gives dist, ubuntu_lxc and ubuntu_vm give safe, no system type gives safe, an inventory-style system_baseline_apt_upgrade: dist wins on ubuntu_lxc, a profile override and an explicit safe win on pve; the update entry point refuses full at once (without the check it would call aptitude). The validation rule accepts safe and dist and refuses full, yes and an empty string.
  • The apt module accepts safe and dist for upgrade (read in the installed apt.py).
  • All commit-stage hooks pass (yamllint, ansible-lint, REUSE, changelog lint, Conventional Commit); --syntax-check passes on the converge playbook.
  • An independent review of the diff, its findings applied.
  • Molecule additions: the resolved input is asserted for pve (dist) and ubuntu_vm (safe), a consumer override of the flat input is asserted, and a refusal case for full in the main flow and one for the update entry point.

Not verified

  • Molecule itself (CI only) and the dist-upgrade on a real Proxmox host: the update tag is skipped in Molecule (no privileged container, and the image is not a Proxmox host), so CI checks only that the profiles resolve and the value is validated. I did not run Kamino's role on a Proxmox node; in my own role a node has been upgraded with dist for months.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #329 New profile key `apt_upgrade` (`safe` or `dist`), resolved to `system_baseline_apt_upgrade`. The `pve` profile uses `dist`, so the update step runs `apt-get dist-upgrade` (the same as `apt full-upgrade`) on a Proxmox VE host; `ubuntu_lxc` and `ubuntu_vm` keep the plain upgrade. `tasks/update.yml` passes the input to the package module (`safe` is the module's name for the plain upgrade, `apt-get upgrade --with-new-pkgs`, which is what `upgrade: true` ran before). The value is validated (`safe` or `dist`, anything else stops the run with a message that names the input), and a consumer can set `system_baseline_apt_upgrade` or the profile key per host. **A correction to the issue text:** it said a safe upgrade never installs a new package. The apt module's safe mode is `upgrade --with-new-pkgs`, which does install new dependencies. The real difference is that `dist-upgrade` can also remove packages an update replaces, which is what a safe upgrade holds back on Proxmox. The Proxmox VE documentation (System Software Updates) updates a node with `apt full-upgrade` and warns that `apt upgrade` "may result in a partially upgraded or broken package state", because `full-upgrade` "can also remove existing packages to satisfy dependencies". The README says it that way. The `apt dist-upgrade` wording in the example I added to the blacklist section in #325 is corrected here to `apt full-upgrade`. **Behaviour changes** - A `pve` host that was upgraded with `safe` until now also gets the packages a safe upgrade held back (a new kernel, `pve-manager` and its dependencies) on the next run. That can restart Proxmox services, and a new kernel needs a reboot. `system_baseline_reboot_if_required` defaults to `true`, so the README tells a consumer to set it to `false` before applying the role to a hypervisor they want to reboot themselves. I did not change that default (the issue asks). - The `update` entry point, a supported interface, follows the same input and now checks it itself (it does not run `validate.yml`): with `system_baseline_system_type: pve` it now upgrades with `dist`. It does not require a system type, so without one it stays on `safe` (the derived input is guarded), and nothing fails for a caller that never sets one. Is following the profile the behaviour you want for the entry point? ## Verified - The resolution, with Ansible's own engine, seven cases: `pve` gives `dist`, `ubuntu_lxc` and `ubuntu_vm` give `safe`, no system type gives `safe`, an inventory-style `system_baseline_apt_upgrade: dist` wins on `ubuntu_lxc`, a profile override and an explicit `safe` win on `pve`; the update entry point refuses `full` at once (without the check it would call aptitude). The validation rule accepts `safe` and `dist` and refuses `full`, `yes` and an empty string. - The apt module accepts `safe` and `dist` for `upgrade` (read in the installed `apt.py`). - All commit-stage hooks pass (yamllint, ansible-lint, REUSE, changelog lint, Conventional Commit); `--syntax-check` passes on the converge playbook. - An independent review of the diff, its findings applied. - Molecule additions: the resolved input is asserted for `pve` (`dist`) and `ubuntu_vm` (`safe`), a consumer override of the flat input is asserted, and a refusal case for `full` in the main flow and one for the update entry point. ## Not verified - Molecule itself (CI only) and the dist-upgrade on a real Proxmox host: the `update` tag is skipped in Molecule (no privileged container, and the image is not a Proxmox host), so CI checks only that the profiles resolve and the value is validated. I did not run Kamino's role on a Proxmox node; in my own role a node has been upgraded with `dist` for months. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Dragonish added 1 commit 2026-11-23 20:21:47 +00:00
feat(system_baseline): run the apt upgrade as dist-upgrade on the pve profile
Build / build (pull_request) Successful in 15s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 13s
c4297b04d3
New profile key apt_upgrade (safe or dist) resolved to
system_baseline_apt_upgrade; the pve profile uses dist, the Ubuntu
profiles keep the plain upgrade. The update entry point follows it when
system_baseline_system_type is set.

Assisted-by: Claude Code
Defame1297 added 1 commit 2026-11-23 20:33:24 +00:00
Merge branch 'main' into feat/329-pve-dist-upgrade
Build / build (pull_request) Successful in 15s
Molecule / molecule (pull_request) Successful in 1m56s
Lint / lint (pull_request) Successful in 1m30s
afb1d4ff51
Dragonish scheduled this pull request to auto merge when all checks succeed 2026-11-23 20:35:06 +00:00
Dragonish merged commit e7edddcab2 into main 2026-11-23 20:37:38 +00:00
Dragonish deleted branch feat/329-pve-dist-upgrade 2026-11-23 20:37:38 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#334