Skip to content

Replace injected Ansible fact variables in download and etcd roles - #13338

Open
NikKumar811 wants to merge 1 commit into
kubernetes-sigs:masterfrom
NikKumar811:fix-ansible-facts-download-role
Open

Replace injected Ansible fact variables in download and etcd roles#13338
NikKumar811 wants to merge 1 commit into
kubernetes-sigs:masterfrom
NikKumar811:fix-ansible-facts-download-role

Conversation

@NikKumar811

Copy link
Copy Markdown
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

/kind cleanup

What this PR does / why we need it:

This PR updates the download, etcd, and etcd_defaults roles to replace usage of injected Ansible fact variables (ansible_*) with ansible_facts[...]. This ensures compatibility with upcoming Ansible 2.24 changes, where fact injection will be disabled by default.

Which issue(s) this PR fixes:

Related to #13208

Special notes for your reviewer:

  • Changes are limited to the download, etcd, and etcd_defaults roles for focused review.
  • Existing logic and behavior are preserved.
  • No changes were made to hostvars, ansible_env, connection variables, or set_fact usage.

Roles reviewed with no required changes:

  • dynamic_groups
  • etcdctl_etcdutl

Does this PR introduce a user-facing change?:

None

@kubernetes-prow kubernetes-prow Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 2, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: NikKumar811
Once this PR has been reviewed and has the lgtm label, please assign yankay for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 2, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from mzaian and tico88612 July 2, 2026 04:04
@kubernetes-prow kubernetes-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 2, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @NikKumar811. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yankay

yankay commented Jul 2, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 2, 2026
@yankay
yankay requested a review from Copilot July 3, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates select tasks/defaults in the download, etcd, and etcd_defaults roles to avoid deprecated injected Ansible fact variables (ansible_*) and instead read facts via ansible_facts[...], aligning Kubespray with the upcoming Ansible 2.24 default behavior (fact injection disabled).

Changes:

  • Replaced ansible_os_family usage with ansible_facts['os_family'] in etcd task conditions and role dependency gating.
  • Replaced ansible_date_time.* usage with ansible_facts['date_time'].* for etcd backup directory naming.
  • Replaced ansible_memtotal_mb usage with ansible_facts['memtotal_mb'] for etcd docker memory-limit defaulting.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
roles/etcd/tasks/upd_ca_trust.yml Switches OS-family branching/conditions to ansible_facts['os_family'] for CA trust update logic.
roles/etcd/meta/main.yml Updates dependency when conditions to use ansible_facts['os_family'] (avoids injected fact vars).
roles/etcd/handlers/backup.yml Uses ansible_facts['date_time'] for timestamped backup directory naming.
roles/etcd_defaults/defaults/main.yml Uses ansible_facts['memtotal_mb'] for memory-based default etcd_memory_limit.
roles/download/tasks/prep_download.yml Updates Flatcar OS-family gating to ansible_facts['os_family'].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@guoard

guoard commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants