Hello everyone,
The subject pretty much sums it up. On each switch, I need to run ‘show lldp info remote-device’ to get the names of all the neighboring switches, then for each port that has a neighboring switch, set the friendly name of that port to the hostname of the neighbor switch. I need to do this for ~600 switches. I wrote some roles to help me do all of this in Ansible, with my custom filters for the CLI output. It all works, but I’m not sure if the way I’ve done it is “The Ansible Way”. Especially if I wanted to extend the functionality from what it currently is, it seems like a lot of the things would be better expressed in a programming language. Yet I still like having the abstractions that aruba_command and aruba_config give. I’m thinking maybe I should write either a module or an action plugin, or maybe a vars plugin? I don’t really know, but I guess right now I’m leaning towards module.
Here’s what my playbook looks like:
`