One of my readers sent me this question:
Other than using Excel (and of course an automation tool) any suggestions for a tool to create device config for some 200 customer VRFs from a standard template?
You need three things to get the job done:
- Data (what values you want to have in each configuration)
- Templating tool and configuration templates
- Some glue that connects the two and generates the configurations.
You can store data in text files (CSV or YAML), Excel spreadsheets, or a database (any database would do, but object-oriented databases might be a better fit than relational ones).
- Have a tool to update the data, and while databases have numerous interesting properties, its way easier to use Notepad, Sublime Text or Excel to update the data;
- Have a mechanism to track changes to the data, and a Git repository is way simpler to implement than any alternative.
Next you need a templating tool. Every programming language has one, and as Python is the new black, you might want to go with Jinja2.
Finally, you need some glue that will take device-specific data, push it through a template, and save the results in a file. Writing a Python script to do that is really easy (unless it’s your first script).
However, the moment you have a tool, you want a more powerful tool. For example, you might want to have global parameters, or groups of devices, or push configurations to the devices, or… and this is where Ansible starts making perfect sense for a minimum investment in tools and programming.
There are people who prefer to do the undifferentiated heavy lifting, and then there are the lazy people (like myself) who like to use the tools that are out there, and once I got familiar with YAML/Jinja2/Ansible combo I wouldn't even think about writing my own Python script to get the job done, but that's just me.
Sounds interesting? Why don’t you explore the Ansible for Networking Engineers webinar, and once you get interested in writing real-life solutions join the Building Network Automation Solutions course?