Ansible + Arista + Netbox

Hello!

this might be quite specific, but I’m loosing the will…

We’re trying to automate our switch configuration using Ansible with Netbox providing the configurations.

I’ve got a dynamic inventory xml which is generated by querying Netbox via the Rest API based on tags.

I want the playbook to pull all the switch information from Netbox and push it to the relevant switch.

I’ve had this working for a single switch on a single interface, but after trying for many hours, I can’t get it to loop through each interface on each switch.

Is anyone doing anything similar? Is this even a good idea? What am I doing with my life?

Hey Ben,

I feel your pain when it comes to designing automation for something. Are you use making your decision making based on the facts pulled from the switch? Care to share a playbook and a debug of the facts you want to loop through?

I am doing this with Cisco. If you understood what you are doing, it is quite simple.

Use the netbox inventory pluging. Be sure to gather the interface information (interfaces: true).
Then use the arista.eos.eos_interfaces module and loop over all interfaces. (or arista.eos.eos_l2_interfaces).

Please contact me directly if you have further questions: ms@sys4.de

At the moment I am compiling some document to describe the network automation with netbox and ansible.

Michael Schwartzkopff