Network configuration CI
A pull request is a proposed change
Continuous integration (CI) runs repeatable checks on a candidate revision before it is accepted. For networks, store structured intent, templates, tests and sanitized evidence in version control. A pull request should identify the affected devices, approved scope, expected behavior, rollback strategy and reviewer. Build a deterministic candidate from a pinned template and inventory revision, not from whatever happens to be in a mutable database during the build. CI success is evidence for review, not permission to deploy. Terraform planning and Git-based review are useful related workflows; a real Terraform plan may contact providers, so this lesson uses no Terraform commands or remote services.
Check format, scope and invariants separately
First parse and type-check the input. Then check addressing, references, platform capabilities and the exact changed fields against the approved scope. In the toy change below, the ticket permits only changing R1 description. The diff also disables R2 and proposes an overlapping Blue subnet. Reject it even if every JSON field has the correct type. Compare the candidate and baseline using stable identities; deletion, new keys and changed keys are all differences. A missing observation should block review rather than be silently interpreted as an empty baseline. A revised candidate must be checked and approved again.
ticket: R1.description onlyR1.description: old -> coreR2.enabled: true -> falseBlue proposed leaf: 10.20.1.128/25result: BLOCK (scope + overlap)Validate service intent, not just syntax
The approved policy for our toy fleet allows staff to reach DNS and denies guest access to management. The observed baseline satisfies both. A candidate that leaves the staff DNS flow intact but allows guest management must fail the semantic check, even if its configuration parses. Verify necessary forward and return paths and policy decisions. Tools such as Batfish can compare modeled forwarding behavior between configuration snapshots, subject to supported features and input completeness. Our fixture instead uses a tiny explicit allow/deny and path model, not Batfish or a router simulator. It cannot prove arbitrary reachability.
Keep the review tied to the exact revision
After a corrected candidate passes, retain its revision, input hashes, test results and approval record. A deployment process must check that the current state still matches the reviewed baseline and that the approved revision has not changed. A speculative Terraform plan is a useful description of a proposed effect, not execution; a later state change may invalidate its assumptions. Store backups with access control and test restoration in an isolated environment. Never include full credentials or sensitive configuration in CI logs. Test environments should mirror relevant features, not connect to shared production networks.
Exercise the gates
Evaluate two revisions: one changes R1 description only with all service checks passing, the other changes R2 enabled to false or has a missing DNS return path. The first is eligible for review, not deployment; the second is blocked. If the approval was for revision 7 but the artifact is revision 8, reject even if all tests pass. Next, decide how to roll out an approved revision with bounded risk.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Network configuration CI Quiz
Reason about inventory authority, change verification and reliability gates.
Ticket permits R1 description only; R2 enabled also changes. What next?
Which test checks network behavior rather than syntax?
Candidate newly permits guest management. What next?
Approved revision 7 differs from artifact revision 8. What next?
Does a speculative Terraform plan prove deployment success?