fix: read facts through ansible_facts and run Molecule with fact injection off
ansible-core deprecates injecting facts as top-level variables (removal is scheduled for 2.24, see #364). Three roles still read a bare fact: system_baseline (reboot check, ansible_os_family), docker (APT source line, ansible_distribution_release) and gitea_runner (re-registration backup name, ansible_date_time). With inject_facts_as_vars set to false the system_baseline reboot check failed with "'ansible_os_family' is undefined". They now read ansible_facts[...]; the argument specs and READMEs that name the facts follow. run_molecule_in_ci_image.sh exports ANSIBLE_INJECT_FACT_VARS=False, so a role that reads an injected fact fails its scenario, and a script test keeps the export in place. Refs #364 Assisted-by: Claude Code:claude-sonnet-5-5
This commit is contained in:
1 parent
9c415ee347
commit
26b6e37a09
12 files changed
+41
-13
No files matched your search
@@ -12,7 +12,7 @@ The role targets Ubuntu guests (the `ubuntu_lxc` and `ubuntu_vm` profiles) and P
|
||||
|
||||
## Requirements and run order
|
||||
|
||||
- Facts must be gathered (`gather_facts: true`); `reboot.yml` reads `ansible_os_family`.
|
||||
- Facts must be gathered (`gather_facts: true`); `reboot.yml` reads `ansible_facts['os_family']`.
|
||||
- `system_baseline_system_type` is required and has no default (the role does not read a global such as `system_type`; map it in the inventory). Valid values: `ubuntu_lxc`, `ubuntu_vm` or `pve`.
|
||||
- Use it by its fully qualified name, `mortis.kamino.system_baseline`.
|
||||
- Collections: `community.general` (locale, timezone) and `ansible.posix` (sysctl, mount).
|
||||
|
||||
Reference in new issue
Block a user