Hello all, I have a group of switches that users keep asking me to locate mac address for in order to trace down the exact port and edit that port to a new vlan. Rather than logging into each switch and tracking down the switch where the mac resides, I created an ansible a basic ansible playbook to help me with this:
I’m getting closer using regex…trying to tweak the regex now (Still any help would be appreciated):
Use strip() method to get rid of whitespace
debug:
var: intf[0].strip()
Thanks Pushparaj, I’ll give that a try & let you know
That worked! Thank you very much Pushparaj, you are the man!
To take it one step further, in the output. I’d like to remove any results that have “UPLINK” in them
I have tried the following below, but “{{ intf_corrected2 }}” doesn’t show me what I’m expecting.
I’m expecting to see just the one switch which has the mac and the port isn’t an uplink. Below is where I’m at: