Skip to content

chore(ansible): Fix Ansible playbook deprecation warnings#318

Merged
martyngigg merged 1 commit into
mainfrom
fix-ansible-deprecation-warnings
May 28, 2026
Merged

chore(ansible): Fix Ansible playbook deprecation warnings#318
martyngigg merged 1 commit into
mainfrom
fix-ansible-deprecation-warnings

Conversation

@martyngigg

@martyngigg martyngigg commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

Recent Ansible upgrades caused all old-style fact var injection to cause deprecation warnings:
https://docs.ansible.com/projects/ansible/devel/porting_guides/porting_guide_13.html\#inject-facts-as-vars

Modify playbooks to use the new style.

Summary by CodeRabbit

  • Refactor
    • Updated internal deployment configuration to standardise how environment variables are accessed across system setup tasks.

Recent Ansible upgrades caused all old-style fact var
injection to cause deprecation warnings:
https://docs.ansible.com/projects/ansible/devel/porting_guides/porting_guide_13.html\#inject-facts-as-vars

Modify playbooks to use the new style
@martyngigg martyngigg requested a review from a team as a code owner May 28, 2026 07:38
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d896a733-2e20-4349-8b0e-67871b41f301

📥 Commits

Reviewing files that changed from the base of the PR and between 3cbe9ac and 7ee25a7.

📒 Files selected for processing (2)
  • infra/ansible/roles/elt/tasks/elt_cron_tasks.yml
  • infra/ansible/roles/elt/tasks/main.yml

📝 Walkthrough

Walkthrough

Two Ansible task files in the ELT role are updated to use the current ansible_facts['env'] API instead of the deprecated ansible_env variable dictionary. Main role tasks now reference ansible_facts['env']['HOME'] for AWS and dlt paths and derived ELT directory facts. Cron task files now reference ansible_facts['env']['USER'] for secret directory and file ownership.

Changes

Ansible facts API migration for environment variables

Layer / File(s) Summary
Main role home paths and derived ELT directory facts
infra/ansible/roles/elt/tasks/main.yml
AWS credentials directory (.aws), dlt configuration directory (.dlt), and config templating tasks switch from ansible_env['HOME'] to ansible_facts['env']['HOME']. The three derived ELT directory facts—elt_git_clone_dir, elt_cron_root_dir, elt_cron_logs_root_dir—are rebuilt from the updated home path references.
Cron task secret ownership settings
infra/ansible/roles/elt/tasks/elt_cron_tasks.yml
Secrets directory creation and envvars template rendering tasks update owner and group from ansible_env['USER'] to ansible_facts['env']['USER'] to maintain proper file ownership under the current Ansible facts API.

Poem

A rabbit hops through playbooks bright,
Where HOME and USER paths take flight,
From deprecated ansible_env arrays,
To ansible_facts['env'] modern ways,
The ELT role leaps with facts so right! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing deprecated Ansible fact variable syntax with the new style to fix deprecation warnings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@martyngigg martyngigg merged commit f544b4a into main May 28, 2026
2 checks passed
@martyngigg martyngigg deleted the fix-ansible-deprecation-warnings branch May 28, 2026 07:45
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