cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2610
Views
0
Helpful
1
Replies

Cisco ACI - Ansible/API - Enable/Disable Leaf/Spine Ports

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

1 Reply 1

Claudia de Luna
Spotlight
Spotlight

Hi @LennertBastiaens4385 ,

 

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

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Save 25% on Day-2 Operations Add-On License