cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
229
Views
0
Helpful
7
Replies

Netbox templating and generating complete configuration

ubf22
Level 1
Level 1

Hi!

This is my first ansible journey in the cisco world, been doing this with Juniper before and would appreciate som advice.

My goal is to use Netbox as source of truth and to genereate a complete configuration for each device, not just adding a vlan or generate som vxlan stuff. In the Juniper world we generate a complete config with jinja2 and push to each device with functionality similar to "load overwrite <file>" this loads a complete configuration to the device, can this be done similarly with Cisco equipment? So that we know that config get added and deleted in a correct way.

I have been trying to find a good boiler plate with netbox and ansible but those I have found so far only touches some part of configuration.

Johan

 

7 Replies 7

ubf22
Level 1
Level 1

Thank you, any ideas for a good starting point for managing a complete config with ansible/netbox?

As you already described, generate config based on info from source of truth with jinja templates and then deliver it to device and replace it.

Made it partially for classical campus (interfaces, vlans, so on) and it took more time to populate SoT correctly than made templates/generators.

Yes you can do this, with https://docs.ansible.com/ansible/latest/collections/cisco/ios/ios_config_module.html in here you would use the replace option. You might find a good example on https://developer.cisco.com/codeexchange/ 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

ubf22
Level 1
Level 1

is it safe to do a replace on nxos or will that have impact?

It's similar (but not exactly the same) to applying diff of two configuration in CLI. So if you shut any interface or remove VLAN from trunk or remove VPC domain configuration - then yes, it would be impactful, if you change description on interface - then no.

@ubf22 done this many time, no problem.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io