Fix preflight check failure caused by incorrect ansible_facts lookup …#357
Conversation
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
3 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
pdvian
left a comment
There was a problem hiding this comment.
@swatithombe-blip Could you squash both commits into a single commit?
There was a problem hiding this comment.
Pull request overview
Updates the preflight “NIC Configuration” check to handle network interfaces with hyphens by normalizing interface names before looking up their speed facts, avoiding undefined-variable failures during report generation.
Changes:
- Normalize interface names (
-→_) and prefix withansible_before extracting per-interface speed facts. - Add a default speed value (
-1) when the speed attribute is missing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2779229 to
1325b76
Compare
Yes, Sure ! |
1325b76 to
027ee82
Compare
|
hello @akraitman the CI is broken: do we need to update something with the jenkins worker? |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
jenkins test el9-functional |
a89abc0 to
4ef67b3
Compare
|
jenkins test el10-functional |
|
jenkins test el9-functional |
|
Normalizing interface names before looking them up is the right fix.
I don't understand the reason why you add I would rather use Could you update the PR and re-check on a host with a hyphenated interface and a normal ens/eth host? |
Which builder is it ? |
@akraitman https://jenkins.ceph.com/job/cephadm-ansible-prs-el9-functional/57/console braggi03 |
@asm0deuz I've made changes and verified locally. It is not working as expected; however the previous changes was fixing the issue here is the reason. extract filter syntax issue: The extract filter expects the format extract(container, key) where it looks up container[key]. When you use map('extract', ansible_facts), it tries to use each interface name as a key to look up in ansible_facts, but: ansible_facts['br-ext'] doesn't exist (the hyphenated version) ---- Earlier code chnages working properly because, This works because: It properly constructs the full fact name: ansible_br_ext |
…for interfaces with hyphens (e.g., br-ext → ansible_br_ext)
We have identified the root cause of the issue.
The failure occurs due to how Ansible stores network interface facts. Interfaces
containing hyphens (e.g., br-ext, bond-mgmt) are internally represented with
underscores in ansible_facts (e.g., ansible_br_ext). The existing logic attempted
to access these facts using the original interface names, resulting in undefined
variable errors during preflight checks.
We have implemented a fix to normalize interface names before accessing
ansible_facts and validated the changes in our setup.
Tracker: (https://tracker.ceph.com/issues/75549)