Ansible automates configuration management when manual, device-by-device changes become slow, inconsistent, difficult to track, and prone to error. It centralizes configuration files and applies standardized changes across managed devices. section 25.0 section 25.3
Ansible is written in Python and primarily uses YAML. Its agentless control node connects to managed devices through SSH, or NETCONF, and pushes configuration changes rather than waiting for devices to retrieve them. section 25.2.1
Ansible organizes automation through four main file types and two execution terms:
- Inventory: lists the managed hosts. section 25.3
- Template: uses Jinja2 configuration syntax and variables to produce host-specific configuration files. section 25.3
- Variables: store values that differ between devices. section 25.3
- Playbook: defines the ordered tasks and procedures applied to managed devices. section 25.2.1 section 25.3
- Module: performs a specific task; task: defines one operation in a playbook. section 25.3
Templated router configuration
A template can define commands such as hostname {{hostname}} and interface addresses using {{g0/0addr}} and {{g0/0mask}}. A YAML variables file supplies values such as hostname R1 and 192.168.12.1/255.255.255.252, allowing one structure to produce device-specific configurations.

