feat(system_baseline): run the apt upgrade as dist-upgrade on the pve profile
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
This commit is contained in:
1 parent
97f5328043
commit
c4297b04d3
8 files changed
+110
-5
No files matched your search
@@ -3,10 +3,15 @@
|
||||
# the package module reports `changed` for it, so a scheduled dry run flagged every host whenever a package landed in between. The
|
||||
# tasks_from: update entry point is an explicit request to update and still previews the upgrade in check mode: only main.yml sets
|
||||
# __system_baseline_main_flow. Leftover packages (autoremove) and the cache (autoclean) stay checked either way.
|
||||
- name: Validate the apt upgrade mode
|
||||
ansible.builtin.import_tasks: validate_apt_upgrade.yml
|
||||
|
||||
# safe is the apt module's name for the plain upgrade (apt-get upgrade --with-new-pkgs), what `true` meant here before; dist runs
|
||||
# apt-get dist-upgrade (profile key apt_upgrade, `pve` by default).
|
||||
- name: Update & upgrade apt packages
|
||||
ansible.builtin.package:
|
||||
update_cache: true
|
||||
upgrade: true
|
||||
upgrade: "{{ system_baseline_apt_upgrade }}"
|
||||
cache_valid_time: 3600
|
||||
become: true
|
||||
when: not (ansible_check_mode and __system_baseline_main_flow | default(false))
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
when: system_baseline_tmux_autostart | bool
|
||||
tags: always
|
||||
|
||||
- name: Validate the apt upgrade mode
|
||||
ansible.builtin.import_tasks: validate_apt_upgrade.yml
|
||||
tags: always
|
||||
|
||||
# Each package pattern is written inside a double-quoted apt.conf string, like the origins below: the same characters are refused.
|
||||
- name: Validate the unattended-upgrades package blacklist
|
||||
ansible.builtin.assert:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
# Shared by validate.yml and update.yml: the tasks_from: update entry point does not run validate.yml, and an unknown mode such as `full`
|
||||
# (an apt module value that calls aptitude, which may not be installed) must stop the run before anything changes.
|
||||
- name: Validate the apt upgrade mode
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- system_baseline_apt_upgrade in ['safe', 'dist']
|
||||
fail_msg: >-
|
||||
system_baseline_apt_upgrade is '{{ system_baseline_apt_upgrade }}' and must be safe or dist.
|
||||
quiet: true
|
||||
tags: always
|
||||
Reference in new issue
Block a user