Templating device configs
Network configs are 95% identical text with a handful of values that change per device — hostname, management IP, VLAN list. A template captures the fixed part once and leaves placeholders for the rest, so you render one correct, consistent config per device instead of copy-pasting and hand-editing (the source of most change-window outages).
config = template (fixed structure) + parameters (per-device values)
How it works
Write a Jinja2-style template with {{ variables }} and feed it a JSON object of parameters; the tool substitutes the values and returns the finished config. Supply a JSON array and you get one config per element — a whole fleet in a single pass. It is the same idea Ansible and Terraform use, distilled to a copy-paste-friendly form for quick, one-off jobs.
template: hostname {{ name }}
interface mgmt0
ip address {{ mgmt_ip }} 255.255.255.0
params: { "name": "sw01", "mgmt_ip": "10.0.0.11" }
result: hostname sw01
interface mgmt0
ip address 10.0.0.11 255.255.255.0
Related
- YAML Validator · JSON Syntax Tester
- Insomnia as an API remote control — push the rendered config over an API.