-
Notifications
You must be signed in to change notification settings - Fork 10
ci: use by default INJECT_FACTS_AS_VARS=false #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConfigures Ansible to run with INJECT_FACTS_AS_VARS disabled in CI workflows by propagating the corresponding environment/TF variable, preparing for Ansible 2.20+ behavior where facts are only available under ansible_facts. Flow diagram for environment propagation of SR_ANSIBLE_INJECT_FACT_VARSflowchart TD
start([CI_run_started])
readWorkflow["Read tft.yml workflow"]
runSetVars["Run set_vars step<br/>populate ARTIFACTS_DIR, ARTIFACTS_URL"]
buildEnv["Build env_vars string for Terraform<br/>include SR_ANSIBLE_INJECT_FACT_VARS=false"]
runTF["Run Terraform with env_vars"]
tfToAnsible["Terraform invokes Ansible<br/>with INJECT_FACTS_AS_VARS=false"]
ansibleFacts["Ansible exposes facts only under ansible_facts"]
ciEnd([CI_run_completed])
start --> readWorkflow --> runSetVars --> buildEnv --> runTF --> tfToAnsible --> ansibleFacts --> ciEnd
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- The new env var names differ (
SR_ANSIBLE_INJECT_FACT_VARSvsANSIBLE_INJECT_FACT_VARS); double-check this is intentional and aligned with how the variable is consumed in downstream scripts or jobs. - Consider being consistent with the value type for
ANSIBLE_INJECT_FACT_VARS(unquotedfalsevs quoted"false") so that any consumers that treat it as a boolean or string behave predictably.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new env var names differ (`SR_ANSIBLE_INJECT_FACT_VARS` vs `ANSIBLE_INJECT_FACT_VARS`); double-check this is intentional and aligned with how the variable is consumed in downstream scripts or jobs.
- Consider being consistent with the value type for `ANSIBLE_INJECT_FACT_VARS` (unquoted `false` vs quoted `"false"`) so that any consumers that treat it as a boolean or string behave predictably.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
582b123 to
028d35e
Compare
…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>
028d35e to
5c3531e
Compare
Ansible 2.20 has deprecated the use of Ansible facts as variables. For
example,
ansible_distributionis now deprecated in favor ofansible_facts["distribution"]. This is due to making the defaultsetting
INJECT_FACTS_AS_VARS=false. For now, this will create WARNINGmessages, 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
Summary by Sourcery
CI: