Merge remote-tracking branch 'origin/main' into feat/400-skip-upgrade-during-vzdump
Lint / lint (pull_request) Successful in 2m46s
Build / build (pull_request) Successful in 38s
Molecule / molecule (pull_request) Successful in 9m12s

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-27 18:52:49 +00:00
commit 008039c60c
61 files changed
+1623 -612

No files matched your search

+2 -1
View File
@@ -17,7 +17,7 @@
- name: Configure unattended-upgrades
ansible.builtin.import_tasks: unattended_upgrades.yml
when: "'unattended-upgrades' in system_baseline_essential_packages"
when: "'unattended-upgrades' in __system_baseline_install_packages"
tags: unattended-upgrades
- name: Set locale
@@ -30,6 +30,7 @@
- name: Cap the journal size
ansible.builtin.import_tasks: journald.yml
when: system_baseline_journal_max_use | length > 0
tags: journald
- name: Bound a hung apt-daily.service
+2 -2
View File
@@ -1,7 +1,7 @@
---
- name: Install essential packages
ansible.builtin.package:
name: "{{ system_baseline_essential_packages }}"
name: "{{ __system_baseline_install_packages }}"
state: present
update_cache: true
become: true
@@ -16,6 +16,6 @@
name: "{{ item }}"
state: absent
purge: true
loop: "{{ system_baseline_remove_packages }}"
loop: "{{ __system_baseline_purge_packages }}"
when: item in ansible_facts.packages
become: true
+1 -1
View File
@@ -4,7 +4,7 @@
ansible.builtin.import_tasks: validate_reboot.yml
- name: Check if reboot required (Debian)
when: ansible_os_family == "Debian"
when: ansible_facts['os_family'] == "Debian"
block:
- name: Check if reboot is required (Debian)
ansible.builtin.stat:
+6 -5
View File
@@ -4,9 +4,10 @@
# connection, so scp, sftp, `ssh host command` and automation never trigger it.
# sshd's ForceCommand is deliberately not used: it applies to every session type and a broken tmux would lock out all of them.
#
# Installed when autostart is on and the resolved package list holds tmux (the ubuntu_lxc and ubuntu_vm profiles); the inputs are
# checked in validate.yml. Security: the session name, window names and commands are role inputs (inventory), never read from a user
# or a fact. They are validated and shell-quoted in the template. The script is root-owned and not writable by the users it runs for.
# Installed when autostart is on and the packages to install hold tmux (the ubuntu_lxc and ubuntu_vm profiles, or
# system_baseline_extra_packages); the inputs are checked in validate.yml. Security: the session name, window names and commands are
# role inputs (inventory), never read from a user or a fact. They are validated and shell-quoted in the template. The script is
# root-owned and not writable by the users it runs for.
# It is world-readable and the commands show in `ps`, so a command must hold no secret. Commands run as the user who logs in.
- name: Install the tmux auto-start snippet
ansible.builtin.template:
@@ -16,12 +17,12 @@
group: root
mode: "0644"
validate: /bin/sh -n %s
when: system_baseline_tmux_autostart | bool and 'tmux' in system_baseline_essential_packages
when: system_baseline_tmux_autostart | bool and 'tmux' in __system_baseline_install_packages
become: true
- name: Remove the tmux auto-start snippet
ansible.builtin.file:
path: /etc/profile.d/tmux-autostart.sh
state: absent
when: not (system_baseline_tmux_autostart | bool and 'tmux' in system_baseline_essential_packages)
when: not (system_baseline_tmux_autostart | bool and 'tmux' in __system_baseline_install_packages)
become: true
+50
View File
@@ -47,6 +47,19 @@
ansible.builtin.import_tasks: validate_reboot.yml
tags: always
# The value is written into a journald drop-in: a number and a unit letter, so a bare number (journald reads it as bytes), a space or a line
# break (a second directive) never reaches the file. Empty leaves the host alone, as for the apt-daily timeout.
- name: Validate the journal size cap
ansible.builtin.assert:
that:
- system_baseline_journal_max_use is string
- system_baseline_journal_max_use == '' or system_baseline_journal_max_use is match('^(infinity|[0-9]+[KMGT])\Z')
fail_msg: >-
system_baseline_journal_max_use must be empty (leave journald alone), infinity or a size such as 200M or 2G
(a number and one of K, M, G, T; a bare number is refused, journald would read it as bytes).
quiet: true
tags: always
# The value is written into a unit file: one line, starting with a digit, so no line break can add a second directive. systemd itself
# refuses a value it cannot parse (it ignores the setting and logs it).
- name: Validate the apt-daily start timeout
@@ -75,6 +88,43 @@
quiet: true
tags: always
# The extras are appended to the resolved lists. An item must be a Debian package name (policy: lower-case letters, digits, + - . , two or
# more characters, starting with a letter or digit), and not end in a minus: apt reads `jq-` as "remove jq", and a null item would become the
# package "None". A bare string is rejected here as it is for the blacklist. A package that one input installs and another purges would be
# installed and removed on every run, so it stops the run; only overlaps that involve an extra are checked, the resolved lists themselves
# are the consumer's.
- name: Validate the extra packages
ansible.builtin.assert:
that:
- system_baseline_extra_packages is sequence
- system_baseline_extra_packages is not string
- system_baseline_extra_packages is not mapping
- system_baseline_extra_packages | select('string') | select('match', '^[a-z0-9][a-z0-9+.-]*[a-z0-9+.]\Z') | list | length
== system_baseline_extra_packages | length
- system_baseline_extra_remove_packages is sequence
- system_baseline_extra_remove_packages is not string
- system_baseline_extra_remove_packages is not mapping
- system_baseline_extra_remove_packages | select('string') | select('match', '^[a-z0-9][a-z0-9+.-]*[a-z0-9+.]\Z') | list | length
== system_baseline_extra_remove_packages | length
fail_msg: >-
system_baseline_extra_packages and system_baseline_extra_remove_packages must be lists of package names: lower-case letters,
digits, + - . only, two or more characters, starting with a letter or digit and not ending in a minus.
quiet: true
tags: always
- name: Refuse a package that is both installed and purged
ansible.builtin.assert:
that:
- system_baseline_extra_packages | intersect(__system_baseline_purge_packages) | length == 0
- system_baseline_extra_remove_packages | intersect(__system_baseline_install_packages) | length == 0
fail_msg: >-
A package is both installed and purged. system_baseline_extra_packages must not name a package of system_baseline_remove_packages or
system_baseline_extra_remove_packages, and system_baseline_extra_remove_packages must not name a package of
system_baseline_essential_packages. Found: {{ (system_baseline_extra_packages | intersect(__system_baseline_purge_packages)) +
(system_baseline_extra_remove_packages | intersect(__system_baseline_install_packages)) }}.
quiet: true
tags: always
# Each origin is written inside a double-quoted apt.conf string: a quote or a line break would end it, a backslash could escape.
- name: Validate the unattended-upgrades origins
ansible.builtin.assert: