Skip to content

Fix inject facts as vars#1672

Merged
swalkinshaw merged 1 commit into
masterfrom
fix-inject-facts-as-vars
Jun 18, 2026
Merged

Fix inject facts as vars#1672
swalkinshaw merged 1 commit into
masterfrom
fix-inject-facts-as-vars

Conversation

@swalkinshaw

@swalkinshaw swalkinshaw commented Jun 18, 2026

Copy link
Copy Markdown
Member

Closes #1667

Access gathered facts via the ansible_facts dictionary rather than the injected top-level ansible_* variables in roles we control:

  • mariadb: ansible_hostname, ansible_distribution_release
  • nginx: ansible_distribution_release
  • xdebug-tunnel: ansible_user_id, ansible_default_ipv4

Also bump roots.mailpit to v1.0.1, which makes the same migration for its ansible_architecture reference, so no actively-run role references a top-level fact var anymore.

INJECT_FACTS_AS_VARS can't be changed yet due to one upstream issue. We are blocked by geerlingguy/ansible-role-ntp#149

Access gathered facts via the `ansible_facts` dictionary rather than the
injected top-level `ansible_*` variables in roles we control:

- mariadb: ansible_hostname, ansible_distribution_release
- nginx: ansible_distribution_release
- xdebug-tunnel: ansible_user_id, ansible_default_ipv4

`INJECT_FACTS_AS_VARS` defaulting to `True` is deprecated and will be
removed in ansible-core 2.24, after which top-level facts are no longer
auto-injected. Using `ansible_facts[...]` keeps these references working
once that default flips (or when `inject_facts_as_vars = False` is set).

Also bump roots.mailpit to v1.0.1, which makes the same migration for its
`ansible_architecture` reference, so no actively-run role references a
top-level fact var anymore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@swalkinshaw swalkinshaw force-pushed the fix-inject-facts-as-vars branch from 1a984b7 to 9c3e7c8 Compare June 18, 2026 15:19
@swalkinshaw swalkinshaw merged commit 56e3155 into master Jun 18, 2026
2 checks passed
@swalkinshaw swalkinshaw deleted the fix-inject-facts-as-vars branch June 18, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEPRECATION WARNING]: INJECT_FACTS_AS_VARS default to True is deprecated

1 participant