fix(global_defaults): apply mirror default in pre-computed system_cfg path
This commit is contained in:
@@ -29,6 +29,25 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
system_cfg: "{{ system_defaults | combine(system | default({}), recursive=True) | combine(system_cfg, recursive=True) }}"
|
system_cfg: "{{ system_defaults | combine(system | default({}), recursive=True) | combine(system_cfg, recursive=True) }}"
|
||||||
|
|
||||||
|
- name: Apply mirror default for pre-computed system_cfg
|
||||||
|
when:
|
||||||
|
- system_cfg is defined
|
||||||
|
- _bootstrap_needs_enrichment | default(false) | bool
|
||||||
|
- system_cfg.mirror | default('') | string | trim | length == 0
|
||||||
|
vars:
|
||||||
|
# Same as _normalize_system.yml — kept in sync manually.
|
||||||
|
_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: >-
|
||||||
|
{{
|
||||||
|
system_cfg | combine({
|
||||||
|
'mirror': _mirror_defaults[system_cfg.os | default('') | string | lower] | default('')
|
||||||
|
}, recursive=True)
|
||||||
|
}}
|
||||||
|
|
||||||
- name: Derive convenience facts from pre-computed system_cfg
|
- name: Derive convenience facts from pre-computed system_cfg
|
||||||
when:
|
when:
|
||||||
- system_cfg is defined
|
- system_cfg is defined
|
||||||
|
|||||||
Reference in New Issue
Block a user