12-16-2019 12:29 AM - edited 12-19-2019 06:35 AM
Hi Community
Is there a way to Disable/Enable physical leaf/spine interfaces via Ansible (or via rest API)?
We have a scenario where we automated need to "shut" one port and "no shut" an other.
Kr,
Lennert
12-16-2019 06:13 AM - edited 12-16-2019 06:16 AM
I would be very interested to learn the use case for this as I don't often see this but in any case...
There is a playbook called port_blacklist.yml in the repo below. The APIC simulators don't do a great job with testing physical layer stuff so this has not been tested on actual hardware but I'd love your feedback!
https://github.com/cldeluna/cisco_aci
port_blacklist.yml -- Sample Playbook which takes a payload data YAML file (group_vars/port_blacklist_payload_data.yml), builds the required payload to disable (blacklist) or enable interfaces using a Jinja2 template (templates/int_enable_disable.j2) and pushes that payload to the APIC.
The Payload data is a list of dictionaries that allows you to set the Pod, Node, Interface, and if you want to disable (blacklist it) or enable it.
group_vars/port_blacklist_payload_data.yml
# Interface Black list int_blacklist: - pod: 1 node: 101 interface: 1/2 blacklist: no - pod: 1 node: 101 interface: 1/5 blacklist: no - pod: 1 node: 102 interface: 1/2 blacklist: yes - pod: 1 node: 102 interface: 1/5 blacklist: yes change_ticket: TEST123
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide