Skip to content

Consistently access facts via the ansible_facts.* namespace - #304

Open
Normo wants to merge 3 commits into
geerlingguy:masterfrom
Normo:ansible-facts-namespace
Open

Normo wants to merge 3 commits into
geerlingguy:masterfrom
Normo:ansible-facts-namespace

Conversation

@Normo

@Normo Normo commented Sep 3, 2026

Copy link
Copy Markdown

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.

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.

1 participant