Automation#08
Automated Cisco configuration with Ansible
Versioned templates generate switch configuration: VLANs, interfaces, NTP, syslog and AAA identical everywhere, backed up daily to Git.
Year2025
RoleDevelopment & testing
- Check / diff mode
- Versioned configs
- Role-based templates
Problem
Configuring each switch by hand caused drift between devices and left no reliable record of changes.
Solution
Ansible inventory per site and role, Jinja2 templates for VLANs, interfaces and base services, check/diff runs before applying, and daily configuration backups to a Git repository. Validated on a Cisco IOS lab in EVE-NG.
Architecture
Code
Engine
Review
Devices
Tap an element to see its role, or follow a path.
Outcome
A change is prepared once, reviewed as a diff, then applied to the whole fleet; every configuration has a history.
111
command for the whole fleet
100%100%100%
configs versioned
Key steps
- 01
Cisco IOS switch lab in EVE-NG
- 02
Inventory per site and role (access, distribution, core)
- 03
Jinja2 templates for VLANs, interfaces, NTP, syslog and AAA
- 04
Systematic check / diff before any change
- 05
Daily configuration backups to Git
In the notebook
Stack
AnsibleJinja2Cisco IOSGitEVE-NG