system_baseline_essential_packages and system_baseline_remove_packages replace the whole list, and so does a list inside system_baseline_profile_overrides, so adding one package meant repeating the profile's list and keeping it in step with every release. system_baseline_extra_packages and system_baseline_extra_remove_packages (lists, default empty) append to the resolved lists. The tmux and unattended-upgrades checks read the combined list, so an extra tmux or unattended-upgrades enables the matching task like a profile package. Items must be Debian package names: a null item would have become the package "None", and apt reads a trailing minus (jq-) as a removal. A package that one input installs and another purges stops the run before any change; only overlaps that involve an extra are checked, so a consumer's own overlap between the resolved lists behaves as before. A flat input that is a plain string still counts as a one-item list. With both inputs left at their default the role behaves as before. Closes #399 Assisted-by: Claude Code:claude-sonnet-5-5
22 lines
514 B
YAML
22 lines
514 B
YAML
---
|
|
- name: Install essential packages
|
|
ansible.builtin.package:
|
|
name: "{{ __system_baseline_install_packages }}"
|
|
state: present
|
|
update_cache: true
|
|
become: true
|
|
|
|
- name: Gather installed packages
|
|
ansible.builtin.package_facts:
|
|
manager: auto
|
|
become: true
|
|
|
|
- name: Remove unnecessary packages if installed
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: absent
|
|
purge: true
|
|
loop: "{{ __system_baseline_purge_packages }}"
|
|
when: item in ansible_facts.packages
|
|
become: true
|