Skip to content

Conversation

@Normo
Copy link
Contributor

@Normo Normo commented Nov 20, 2025

Fixes deprecation warning:

[DEPRECATION WARNING]: INJECT_FACTS_AS_VARS default to `True` is deprecated, top-level facts will not be auto injected after the change. This feature will be removed from ansible-core version 2.24.

Currently, the role failed to run with INJECT_FACTS_AS_VARS set to False as the required ansible_* variables are not defined.

The configuration variable INJECT_FACTS_AS_VARS and the Ansible fact namespace ansible_facts.* have been added in Ansible 2.5. In the porting guide of that version, it stated that:

A new configuration variable, inject_facts_as_vars, has been added to ansible.cfg. Its default setting, 'True', keeps the 2.4 behavior of facts variables being set in the old ansible_* locations (while also writing them to the new namespace). This variable is expected to be set to 'False' in a future release. When inject_facts_as_vars is set to False, you must refer to ansible_facts through the new ansible_facts.* namespace.

@Normo Normo marked this pull request as ready for review November 20, 2025 08:10
@schurzi
Copy link
Contributor

schurzi commented Nov 26, 2025

Nice catch, I'd like to use this to get our tests green again. I think there is still a problem with the verifier using a different env and thus breaking the tests. Do you have te capacity to look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants