I am banging my head against the wall on this one. I am writing an Ansible playbook using NETCONF that retrieves a list of interfaces that have an ACL configured and then using the XML response, create a new payload that removes the ACL. I am able to get the interfaces no problem using a XPath filter but I cannot figure out how to handle the multiple interface types when creating the payload to send back.
I am using Ansible's parse_xml filter to convert the XML response into a data structure I can then use to template out the XML payload. The issue I am having is I cannot figure out how to capture the interface type tag when parsing the XML. The only way I can make it work is to statically set the interface type (e.g. GigabitEthernet or FiveGigEthernet) and loop over that. The issue with that approach is I have to add every possible interface type to my playbook.
Has anyone done this before? Almost 100% of tutorials / examples for NETCONF show how to modify a single interface and nothing more advanced than that (maybe I'll write one when I figure this out :|)
Here's the xml spec for parse_xml filter I'm using (currently looping only over GigabitEthernet):