Skip to content

refactor: handle INJECT_FACTS_AS_VARS=false by using ansible_facts instead#333

Merged
richm merged 1 commit intoredhat-cop:mainfrom
richm:inject-facts-as-vars
Jan 12, 2026
Merged

refactor: handle INJECT_FACTS_AS_VARS=false by using ansible_facts instead#333
richm merged 1 commit intoredhat-cop:mainfrom
richm:inject-facts-as-vars

Conversation

@richm
Copy link
Collaborator

@richm richm commented Jan 8, 2026

Ansible 2.20 has deprecated the use of Ansible facts as variables. For
example, ansible_distribution is now deprecated in favor of
ansible_facts["distribution"]. This is due to making the default
setting INJECT_FACTS_AS_VARS=false. For now, this will create WARNING
messages, but in Ansible 2.24 it will be an error.

See https://docs.ansible.com/projects/ansible/latest/porting_guides/porting_guide_core_2.20.html#inject-facts-as-vars

Signed-off-by: Rich Megginson rmeggins@redhat.com

@richm richm requested a review from spetrosi January 8, 2026 22:44
@richm richm force-pushed the inject-facts-as-vars branch 2 times, most recently from 76fcd05 to be9534a Compare January 8, 2026 23:07
…stead

Ansible 2.20 has deprecated the use of Ansible facts as variables.  For
example, `ansible_distribution` is now deprecated in favor of
`ansible_facts["distribution"]`.  This is due to making the default
setting `INJECT_FACTS_AS_VARS=false`.  For now, this will create WARNING
messages, but in Ansible 2.24 it will be an error.

See https://docs.ansible.com/projects/ansible/latest/porting_guides/porting_guide_core_2.20.html#inject-facts-as-vars

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm force-pushed the inject-facts-as-vars branch from be9534a to cec53f2 Compare January 8, 2026 23:11
@richm
Copy link
Collaborator Author

richm commented Jan 8, 2026

[citest]

@richm richm merged commit 363689e into redhat-cop:main Jan 12, 2026
25 checks passed
@richm richm deleted the inject-facts-as-vars branch January 12, 2026 14:16
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.

3 participants