Skip to content

Conversation

@Hazerre
Copy link

@Hazerre Hazerre commented Oct 31, 2025

Description:

  • Fixes issue with Linux Ansible syntax when ran against systems with interfaces such as bond.70@bond0.

Rationale:

  • Enhance existing Jinja filtering to ensure proper handling of non-standard interfaces by further refining registered item.

Fixes #11901

Review Hints:

  • Existing filters will reduce registered item to only the interface name by extracting the content between two : delimiters. The enhancements will take the output of that and further reduce the item by extracting the content left of the first @ delimiter. This results in the bond.70@bond0 becoming bond.70 as that is the first item (0) in this delimited list.

  • Example registered item: 3: bond.70@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ab:cd:ef:12:34:56 brd ff:ff:ff:ff:ff:ff\ altname enxabcdef123456

  • Existing jinja template filter results: bond.70@bond0

  • Enhanced jinja template filter results: bond.70

  • Good examples are useful commands, if it is better to review all commits together or in a suggested sequence, any relevant discussion in other PRs or issues, etc.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Oct 31, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 31, 2025

Hi @Hazerre. Thanks for your PR.

I'm waiting for a github.com 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. Regular contributors should join the org to skip this step.

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.

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.

@jan-cerny jan-cerny self-assigned this Nov 3, 2025
@jan-cerny jan-cerny added this to the 0.1.79 milestone Nov 3, 2025
- name: "{{{ rule_title }}} - Disable promiscuous mode"
ansible.builtin.command:
cmd: ip link set dev {{ item.split(':')[1] }} multicast off promisc off
cmd: ip link set dev {{ (item.split(':')[1] | trim).split('@')[0] }} multicast off promisc off
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your change looks good to me. However, I have noticed a suspicious thing that exists below on line 16.

network_interfaces.stdout_lines is defined and "item.split(':') | length == 3"

I think that the double quotes shouldn't be there because they represent a string literal, not a jinja expression.

I think it should be:

network_interfaces.stdout_lines is defined and item.split(':') | length == 3

Can you take a look into this?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch. I'm not sure why it was like that before or how it was passing tests. Added another commit to resolve that.

Fixed an odd when statement being a string. Not sure why this was like this before or why it passed automated testing. The previous implementation failed my personal testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

network_sniffer_disabled RHEL8 Playbook Task Failing

2 participants