Use it when choosing how to automate the network, or when a tool's change does not land on the devices.
Automation & Controllers
Automation and controllers: a controller (Catalyst Center, SD-WAN Manager) manages devices centrally through southbound APIs and offers northbound APIs; tools such as Ansible (agentless, procedural playbooks) and Terraform (declarative state) automate changes against devices and controllers.
1. Controller or tool reachable and authenticated?
2. Dry run: ansible-playbook site.yml --check --diff / terraform plan — expected changes only?
3. Apply, then read the device state back.
4. Drift → someone changed the device by CLI; reconcile in the source of truth.
5. Failed task → read the module's error message and the device log.
source of truth → data validated → API or tool authenticated → change applied idempotently → state read back → matches intent
Context & applicabilityCommon mistakes · platform/version boundaries
A script exiting without an error is not evidence that the intended infrastructure state exists. Always verify the target system and distinguish transport success from state change success.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification & show-command thinking Verify boundary
Verify JSON types/keys, HTTP method/path/status, controller intent and post-change network state.
Step 2 Common failure patterns Narrow the fault
Common faults include malformed data, wrong URI/method, authentication, non-idempotent logic or assuming API success shows network-state success.
Step 3 Evidence-first troubleshooting Narrow the fault
Troubleshoot automation by locating the first failed contract: data/input, transport/auth, API/module behavior, device acceptance or post-state. A script returning success is not sufficient evidence that the intended network behavior exists.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Ansible connects over SSH/NETCONF/APIs with no agent and runs tasks in order; use --check --diff first. Terraform compares desired state with its state file and applies the difference; terraform plan shows it. Do not change controller-managed devices by hand — the controller will overwrite or flag drift.
curl -sk -u <user>:<pw> -H 'Accept: application/yang-data+json' https://<device>/restconf/data/ietf-interfaces:interfaces— RESTCONF read.curl -i— HTTP status code and headers (200 OK, 201 Created, 204 No Content, 400, 401, 403, 404).python3 -m json.tool < file.json/jq . file.json— JSON valid and readable.show netconf-yang status/show platform software yang-management process— device API agents running.show ip http server status— HTTPS server for RESTCONF.
ReferenceWhat it is1 section · depth on demand
Concept overview
Controller-based networking, Ansible/Terraform concepts and automation.
Foundation focus: Model data first, then API/controller workflow, then automation logic and validation.
ReferenceHow it works2 sections · depth on demand
How it works
Infrastructure automation reads current state, applies repeatable intent and verifies the result. Reliable automation is idempotent or state-aware, validates prerequisites, fails visibly and records evidence instead of assuming every target is identical.
Mechanism, scope & boundaries
Automation converts intended network state into repeatable operations. Reliable workflows separate input validation, connection/authentication, current-state discovery, planned delta, execution and post-change verification. Controllers add an abstraction/API layer but do not remove the need to understand device and forwarding state.
ReferenceImportant terms & boundaries2 sections · depth on demand
Important terms and limits
Local intent: Controller-based networking, Ansible/Terraform concepts and automation.
In depth
Automation through controllers
Many automation tasks are easier through a controller than device by device. The controller already knows the inventory, the topology and the policy, and it exposes all of it through one API. Catalyst Center is a typical example:
- Clients obtain a token by sending Basic credentials to
/dna/system/api/v1/auth/tokenover HTTPS. - They send that token in the
X-Auth-Tokenheader on every request. - Tokens are valid for 60 minutes, after which the API returns 401.
Device-level automation compared with controller automation
| Device APIs (NETCONF, RESTCONF, CLI) | Controller APIs | |
|---|---|---|
| Scope | One device | Sites, fabrics, the whole network |
| Inventory | You maintain it | The controller maintains it |
| Data model | YANG per platform | The controller's own model |
| Changes | Per device | Intent: templates, policies, provisioning |
| Validation | Your tests | Controller checks, plus your tests |
| Typical use | Specific features, platforms without a controller | Campus, SD-Access, SD-WAN operations |
Common controller automation tasks
| Task | API area (Catalyst Center) |
|---|---|
| Inventory reports | Devices, sites |
| Health reports | Network health, client health, issues |
| Configuration changes | Templates, provisioning |
| Command collection | Command runner |
| Compliance | Compliance status per device |
| Event-driven actions | Webhooks or event subscriptions to ITSM or chat |
The read, apply, verify pattern
1. Read the current state, for example the devices that need a change.
2. Apply the change through the controller (a template deployment), which returns a task ID.
3. Poll the task until it finishes.
4. Verify the result, for example with compliance or health checks.
dev$ TOKEN=$(curl -s -X POST -u "$CATC_USER:$CATC_PASS" https://catc.example.net/dna/system/api/v1/auth/token | jq -r .Token)
dev$ curl -s -H "X-Auth-Token: $TOKEN" "https://catc.example.net/dna/intent/api/v1/network-device?role=ACCESS" | jq -r '.response[].hostname' | wc -l
48
dev$ curl -s -H "X-Auth-Token: $TOKEN" "https://catc.example.net/dna/intent/api/v1/task/<task-id>" | jq '.response | {isError, progress, endTime}'
Mixing tools
Controllers rarely cover everything. Use the controller for what it manages, and direct device automation for the rest. Keep one source of truth, so the two don't fight over the same settings.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation & Programmability → Automation & Controllers. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%