feat(global_defaults): add system.mirror to schema and normalization

This commit is contained in:
2026-02-22 10:47:40 +01:00
parent fb69c96e4a
commit 79988619c6
2 changed files with 11 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ system_defaults:
timezone: "Europe/Vienna"
locale: "en_US.UTF-8"
keymap: "us"
mirror: ""
packages: []
disks: []
users: []

View File

@@ -10,6 +10,10 @@
if (system_raw.name | default('') | string | trim | length) > 0
else inventory_hostname
}}
_mirror_defaults:
debian: "https://deb.debian.org/debian/"
ubuntu: "http://mirror.ubuntu.com/ubuntu/"
ubuntu-lts: "http://mirror.ubuntu.com/ubuntu/"
ansible.builtin.set_fact:
system_cfg:
# --- Identity & platform ---
@@ -67,6 +71,12 @@
timezone: "{{ system_raw.timezone | string }}"
locale: "{{ system_raw.locale | string }}"
keymap: "{{ system_raw.keymap | string }}"
mirror: >-
{{
system_raw.mirror | string | trim
if (system_raw.mirror | default('') | string | trim | length) > 0
else _mirror_defaults[system_raw.os | default('') | string | lower] | default('')
}}
path: "{{ system_raw.path | default('') | string }}"
packages: >-
{{