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
@@ -4,7 +4,7 @@ Installs Docker Engine from the upstream Docker APT repository, optionally updat
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The key and repository URLs point at `download.docker.com/linux/ubuntu`, and the source line uses `ansible_distribution_release`. The apt architecture is derived from the host (`x86_64` gives `amd64`, `aarch64` gives `arm64`); any other architecture fails the play until `docker_apt_arch` is set. A limited molecule scenario covers the role's own logic (see [Tests](#tests)); the real Docker Engine is not tested.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The key and repository URLs point at `download.docker.com/linux/ubuntu`, and the source line uses `ansible_facts['distribution_release']`. The apt architecture is derived from the host (`x86_64` gives `amd64`, `aarch64` gives `arm64`); any other architecture fails the play until `docker_apt_arch` is set. A limited molecule scenario covers the role's own logic (see [Tests](#tests)); the real Docker Engine is not tested.
|
||||
|
||||
The role targets Ubuntu hosts only: it installs from Docker's Ubuntu repository, so it does not cover Debian trixie (Proxmox hosts).
|
||||
|
||||
@@ -91,7 +91,7 @@ With any of `docker_daemon_options`, `docker_live_restore`, `docker_log_driver`,
|
||||
What it shows, with the role's tasks running unchanged:
|
||||
|
||||
- The key is fetched, stored at `docker_keyring_path` with mode `0644`, and apt really verifies the repository against it (an unsigned or wrongly signed repository would leave no install candidate).
|
||||
- The source line has the architecture, the `signed-by` keyring and `ansible_distribution_release`.
|
||||
- The source line has the architecture, the `signed-by` keyring and `ansible_facts['distribution_release']`.
|
||||
- The packages are installed from that repository, the unit is enabled and active, and `docker_users` join `docker_group`.
|
||||
- `docker_remove` with `docker_remove_data` removes the source line, the keyring, the packages, the unit and `/var/lib/docker`.
|
||||
- Both units are installed, enabled, ordered against `docker.service` as stated, the shutdown unit is active, a unit is removed when its input is `false`, and `docker_remove` removes both.
|
||||
|
||||
Reference in new issue
Block a user