Skip to content

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

Merged
richm merged 1 commit intoperformancecopilot:mainfrom
richm:inject-facts-as-vars
Jan 7, 2026
Merged

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

Conversation

@richm
Copy link
Contributor

@richm richm commented Jan 7, 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.

Also includes a fix - cannot use ansible_managed as a variable

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

…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.

Also includes a fix - cannot use `ansible_managed` as a variable

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 merged commit bc5795e into performancecopilot:main Jan 7, 2026
4 of 6 checks passed
@richm richm deleted the inject-facts-as-vars branch January 7, 2026 17:26
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