cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
79
Views
1
Helpful
0
Comments
Tagir Temirgaliyev
Spotlight
Spotlight

Why we need interface description? for better visibility and better troubleshooting. You connect to switch and you see in log that interface 24 is disconnected. And you need to quickly identify what is wrong and what device is disconnected, and without description you will need additional documents to identify what is wrong. We need also current updated info but manually checking and updating interfaces is very time consuming task.

and there is a solution. ansible script to update descriptions. doesn't matter if you have hundred or thousands of switches.

https://nwmichl.wordpress.com/2020/07/05/fix-your-interface-description-with-ansible-and-cdp-lldp/

I made a small improvement - removed "Connected to ". and added platform.

---
- name: Set Interface description based on CDP/LLDP discovery
hosts: all
gather_facts: yes
connection: network_cli

tasks:

- name: Set IOS Interface Description
ios_config:
lines:
- description {{ item.value[0].host }}|{{ item.value[0].platform }}|{{ item.value[0].port }}
parents: interface {{ item.key }}
save_when: changed
with_dict: "{{ansible_facts.net_neighbors }}"
when: ansible_network_os == 'ios'

the result is as:

RichR_0-1719755940194.png

 

 
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: