Skip to content
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

ios_acls: Fix module failure when ARP ACLs are present on device #1131

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Girish5tri
Copy link
Member

@Girish5tri Girish5tri commented Nov 10, 2024

SUMMARY

This PR fixes an issue with the ios_acls module where it fails when ARP ACLs are present on the device. The module was incorrectly parsing ARP ACL entries, causing errors when configuring extended ACLs with protocol options.

Initial ACL configuration:

ip access-list standard 10
 10 permit 192.168.1.0 0.0.0.255
arp access-list arp-test
 permit ip any mac any

Playbook:

  tasks:
    - name: ACL merge operation
      cisco.ios.ios_acls:
        config:
          - afi: ipv4
            acls:
              - name: ext_acl
                acl_type: extended
                aces:
                  - grant: permit
                    protocol_options:
                      ip: yes
                    source:
                      address: 192.0.2.0
                      wildcard_bits: 0.0.0.255
                    destination:
                      address: 192.0.3.0
                      wildcard_bits: 0.0.0.255

Error:

TASK [ACL merge operation] ***************************************************************************************************************************
fatal: [10.100.201.128]: FAILED! => {"changed": false, "msg": "Unsupported attribute for standard ACL - protocol."}

FIX

Changes made in ios/plugins/module_utils/network/ios/facts/acls/acls.py

    def get_acl_data(self, connection):
        # Removed the show access-list
        # Removed the show running-config | include ip(v6)* access-list|remark
        return connection.get("show running-config | section 'ip[v6]* access-list'")

This ensures the module only processes IP ACLs and ignores ARP ACLs.

Fixes: #1111

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

cisco.ios.ios_acls

@Girish5tri Girish5tri changed the title Fix module failure when ARP ACLs are present on cat9k device Fix ios_acl module failure when ARP ACLs are present on cat9k device Nov 10, 2024
@Girish5tri Girish5tri changed the title Fix ios_acl module failure when ARP ACLs are present on cat9k device ios_acls: Fix module failure when ARP ACLs are present on device Nov 10, 2024
@Girish5tri Girish5tri marked this pull request as ready for review November 10, 2024 22:55
"""\
ip access-list standard 10
10 permit 192.168.1.0 0.0.0.255
arp access-list arp-test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please add a integration test where we add a prepare test to add arp access-list and then gather facts so that we are sure with an appliance too that the facts are handled correctly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure will do it thanks

@roverflow roverflow marked this pull request as draft November 20, 2024 09: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.

ios_acls: operations fail on cat9000 configured with arp ACL
2 participants