Automation · Cisco Automation
State Verification
Cheat sheet · https://pcornel.dk/topic.php?topic=5647
Answer
State verification checks operational status after a change, such as interfaces up, OSPF or BGP neighbours established and routes present, using show commands parsed with TextFSM, Genie or pyATS.
Remember
- Check interfaces, neighbours and routes.
- Parse with TextFSM, Genie or pyATS.
- Compare before and after.
First checks
pyats learn interface --testbed-file tb.yaml— state snapshotgenie diff before/ after/— compareansible <dev> -m cisco.ios.ios_command -a "commands='show ip ospf neighbor'"— quick check
Commands
show ip interface brief- Compact IPv4 interface/address/protocol state.
Verify in this order
pre snapshot → change → post snapshot → diff
Where it usually breaks
Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5647