Files
Kamino/roles/system_baseline/tasks/packages.yml
T
Defame1297 f766666476
Build / build (pull_request) Successful in 31s
Lint / lint (pull_request) Successful in 2m36s
Molecule / molecule (pull_request) Successful in 7m39s
test(system_baseline): run the vzdump guard cases against the guard alone
Each of the seven vzdump cases ran the whole update entry point in check
mode, when they assert only the guard's decision. The guard now lives in
an internal tasks/vzdump_guard.yml, imported by update.yml so the update
tag, when and main-flow vars still reach it. Six cases include it
alone; the ubuntu_lxc case keeps running tasks_from: update end to end,
and a static check asserts the guard is imported before the upgrade and
that the upgrade's when reads its fact.

The purge of unwanted packages becomes one apt call over the installed
ones, skipped when none is installed. The scenario's gathering plays
use gather_subset min: the role reads only os_family and package_facts.

Closes #456

Assisted-by: Claude Code
2026-11-28 21:47:17 +00:00

25 lines
748 B
YAML

---
- name: Install essential packages
ansible.builtin.package:
name: "{{ __system_baseline_install_packages }}"
state: present
update_cache: true
cache_valid_time: 3600
become: true
- name: Gather installed packages
ansible.builtin.package_facts:
manager: auto
become: true
# One apt call for every unwanted package that is installed, skipped when none is.
- name: Remove unnecessary packages if installed
ansible.builtin.package:
name: "{{ __system_baseline_purge_present }}"
state: absent
purge: true
vars:
__system_baseline_purge_present: "{{ __system_baseline_purge_packages | select('in', ansible_facts.packages) | list }}"
when: __system_baseline_purge_present | length > 0
become: true