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
@@ -19,6 +19,51 @@
|
||||
that: "'is invalid' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
|
||||
# The apt upgrade mode is safe or dist: anything else (here `full`, an apt module value the role does not offer) stops the run before
|
||||
# any change, with a message that names the input.
|
||||
- name: An unknown apt upgrade mode is refused
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Run the role with a bad system_baseline_apt_upgrade
|
||||
block:
|
||||
- name: Include system_baseline
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
vars:
|
||||
system_baseline_system_type: ubuntu_lxc
|
||||
system_baseline_apt_upgrade: full
|
||||
- name: Unreachable when validation works
|
||||
ansible.builtin.fail:
|
||||
msg: system_baseline ran with an invalid system_baseline_apt_upgrade
|
||||
rescue:
|
||||
- name: The validation stopped the play
|
||||
ansible.builtin.assert:
|
||||
that: "'system_baseline_apt_upgrade is' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
|
||||
# The update entry point does not run validate.yml, so it checks the mode itself and stops before it calls the package module.
|
||||
- name: The update entry point refuses an unknown apt upgrade mode
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Run the update entry point with a bad system_baseline_apt_upgrade
|
||||
block:
|
||||
- name: Include system_baseline, tasks_from update
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
tasks_from: update
|
||||
vars:
|
||||
system_baseline_apt_upgrade: full
|
||||
- name: Unreachable when validation works
|
||||
ansible.builtin.fail:
|
||||
msg: the update entry point ran with an invalid system_baseline_apt_upgrade
|
||||
rescue:
|
||||
- name: The validation stopped the play
|
||||
ansible.builtin.assert:
|
||||
that: "'system_baseline_apt_upgrade is' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
|
||||
# A quote, a null item and a bare string (not a list) each stop the run: the bare string would otherwise be split into one-character
|
||||
# patterns, and the null item would become an empty pattern that matches every package.
|
||||
- name: A bad package blacklist is refused
|
||||
@@ -69,6 +114,7 @@
|
||||
- system_baseline_unattended_upgrade_settings['Unattended-Upgrade::Automatic-Reboot-Time'] == '03:00'
|
||||
- system_baseline_secure_tmp_mounts == ['/dev/shm', '/tmp', '/var/tmp']
|
||||
- system_baseline_update
|
||||
- system_baseline_apt_upgrade == 'dist'
|
||||
- system_baseline_unattended_upgrade_origins | length == 3
|
||||
- system_baseline_unattended_upgrade_origins | select('search', 'Proxmox') | list == []
|
||||
quiet: true
|
||||
@@ -92,6 +138,7 @@
|
||||
- system_baseline_unattended_upgrade_settings['Unattended-Upgrade::Automatic-Reboot'] == false
|
||||
- system_baseline_unattended_upgrade_settings['Unattended-Upgrade::Automatic-Reboot-Time'] == '04:00'
|
||||
- system_baseline_sysctl_hardening | selectattr('name', 'equalto', 'net.ipv4.conf.all.log_martians') | list | length == 1
|
||||
- system_baseline_apt_upgrade == 'safe'
|
||||
- system_baseline_unattended_upgrade_origins == []
|
||||
quiet: true
|
||||
|
||||
@@ -102,6 +149,7 @@
|
||||
vars:
|
||||
system_baseline_system_type: ubuntu_vm
|
||||
system_baseline_remove_packages: [telnet]
|
||||
system_baseline_apt_upgrade: dist
|
||||
system_baseline_profile_overrides:
|
||||
ubuntu_vm:
|
||||
unattended_upgrade_settings:
|
||||
@@ -116,6 +164,7 @@
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- system_baseline_remove_packages == ['telnet']
|
||||
- system_baseline_apt_upgrade == 'dist'
|
||||
- system_baseline_unattended_upgrade_settings['Unattended-Upgrade::Automatic-Reboot'] == true
|
||||
- system_baseline_unattended_upgrade_settings['Unattended-Upgrade::Automatic-Reboot-Time'] == '04:00'
|
||||
- "'qemu-guest-agent' in system_baseline_essential_packages"
|
||||
|
||||
Reference in new issue
Block a user