You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Network automation depends on separating data (what you want to configure) from logic (how to apply it). Data formats like JSON and YAML store device variables, while template engines like Jinja2 generate device-specific configurations from those variables.
| Approach | Problem |
|---|---|
| Hardcoded configs | Every device needs a separate script; changes require editing code |
| Data + Template | Write the template once, feed in different data for each device |
Data (YAML) + Template (Jinja2) = Device Config
───────────── ────────────── ──────────────
hostname: R1 hostname {{ hostname }} hostname R1
mgmt_ip: 10.0.0.1 interface Mgmt0 interface Mgmt0
ip address {{ mgmt_ip }} ip address 10.0.0.1
JSON is a lightweight, text-based data format widely used by APIs and automation tools:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.