Job search
Network Automation Portfolio: Prove a Change with Prechecks, Postchecks, and Recovery
Use an actual isolated Python simulated-switch change and seven cases to document scope checks, verified backup, observed state, idempotence and recovery disposition.
A network automation portfolio becomes easier to evaluate when it shows a complete decision: what state was expected, what change was permitted, what was observed afterward, and whether recovery restored the starting state. A successful connection or a generated configuration file leaves most of that story unfinished.
For this guide, we executed an original Python 3.12.14 experiment against local JSON files representing a simulated switch. It includes a successful change, a second run, rejected inputs, a failed backup, a failed postcheck and two recovery outcomes. No network device, SSH session, production configuration or packet traffic was involved. LandOffer publishes this guide; compare recent LandOffer.ai roles to decide which networking responsibilities your evidence should address.

Start with a change contract a reviewer can inspect
Write the intended transition before the automation. Name the target resource, the permitted difference and the resources that must remain unchanged. That gives the reviewer something stronger than a screenshot showing that a script finished.
Our model is LAB-SW1, an invented device stored as JSON. It contains VLAN 10 named users, VLAN 99 named management, and two enabled access ports initially assigned to VLAN 10. The management record uses mgmt0, VLAN 99 and 198.51.100.10/24 as model data. That address was never contacted.
The permitted change adds VLAN 20 named lab-analytics and moves only access2 to VLAN 20. The management record, access1, existing VLAN definitions and enabled flags must stay unchanged. Acceptance requires the entire observed model to match the declared target, including the resources that must not change. This is intentionally narrower than a general-purpose network configuration engine.
The contract also identifies uncertainty. The model contains no routing table, spanning-tree state, link negotiation or application traffic. An accepted JSON transition demonstrates the program's stated checks, not working inter-VLAN communication or compatibility with a Cisco command parser.
Use documentation to distinguish intent from observation
Ansible's current network resource module documentation distinguishes operations that merge, replace or override resource configuration. It warns that an override can remove management access. It also distinguishes offline rendering or parsing from collecting state on a device.
That distinction matters in a portfolio using Ansible: rendered commands are an intended configuration, while collected state is evidence from the environment you actually queried. Explain which module, state and platform you used; do not imply that an offline rendering step applied or verified a device change.
Our experiment does not execute Ansible or reproduce its module behavior. It uses a small original Python model to make prechecks, observed state and recovery easy to inspect. The documentation supplies context for why explicit scope matters, not proof that this script is a supported device implementation.
Make prechecks capable of stopping the change
The harness reads the starting file and compares its SHA-256 digest with the expected baseline. It rejects a mismatch before applying the change. It then checks the model kind, the allowed target and the protected management and access1 records. Unexpected starting content cannot quietly become the basis for a new accepted change.
Next it creates a backup and reads it back for byte equality. An injected backup-write failure aborts before the candidate is written. Merely naming a backup file would not satisfy this check.
The run uses Python's TemporaryDirectory context manager for disposable fixture files. The final report is saved outside that temporary directory before the context exits. This keeps durable evidence of the experiment while separating it from the device-model files used during each case. It does not establish process isolation equivalent to a container or virtual machine.
Every rejection should say what stopped the operation. “Baseline hash mismatch” and “scope or protected-resource mismatch” lead to different investigations. Preserve that reason alongside whether a candidate write occurred. The reviewer can then tell whether a guard prevented the change or whether an applied change required recovery.
Worked asset one: the completed successful change record
The following record reports an actual execution of the local model. The device and change request are fictional; the file mutations, comparisons and assertions were executed for this article.
| Record field | Executed finding |
|---|---|
| Starting state | Both access ports were enabled on VLAN 10; management used VLAN 99. |
| Allowed target | Only access2 could move; management and access1 were protected. |
| Expected difference | Add VLAN 20 named lab-analytics and assign access2 to it. |
| Precheck | Expected baseline digest and protected records matched. |
| Backup | Starting bytes were saved and read back equal before application. |
| Applied change | The harness wrote the intended model to the local JSON device file. |
| Postcheck | Reading the file back produced the complete intended model, including unchanged protected content. |
| Disposition | accepted_model_change; a second run returned unchanged with zero candidate writes. |
The baseline digest began 4ce1a6f33041; the accepted model's digest began 34ef8b31e8f1. Full digests and before/after objects are retained in the saved result. These prefixes identify this fixture's content; they are not authentication credentials or proof of a network device's identity.
The completed acceptance memo reads: “Accept the bounded model change. The observed local file matches the entire intended object, and a repeat execution against that state requires no additional write. This establishes the expected transition and no-op behavior for this fixture. It does not prove delivery through a network transport, hardware forwarding, management reachability or crash-safe persistence.”
The memo gives the reviewer a bounded conclusion to inspect. The reviewer can examine a specific accepted change and its limits, rather than infer success from the presence of a new VLAN number somewhere in a log.
Postchecks need an observation independent of the candidate object
After writing the candidate, the harness reads and parses the file again. It compares that observed object with the intended object. It does not simply inspect the in-memory object that it meant to write and call the operation successful.
This remains a narrow observation: local file content. In a separately authorized network lab, the equivalent checks would need to address the actual device and relevant behavior. A configuration readback, a management-path check and an application-level test answer different questions; select them according to the change contract.
Ansible's check and diff mode guide explains that support varies by module and that check mode is a simulation. Tasks can also be configured to run normally despite check mode. A flag in a command line therefore does not establish that every task was simulated or that a subsequent change worked. Our reported results come from the executed Python harness, not an Ansible dry run.

Worked asset two: the failure and recovery disposition
A second case deliberately changes the management address in the local model after the intended candidate is written. The observed model therefore fails the postcheck. The harness restores the verified backup and then compares the restored bytes with the original bytes.
This completed failure record includes a separate variation in which restoration itself is deliberately corrupted. That negative test checks whether the program falsely reports a successful recovery merely because a restore write was attempted.
| Failure record field | Executed finding and disposition |
|---|---|
| Intended change | The same access2/VLAN 20 transition as the positive case. |
| Injected deviation | Management address changed to 198.51.100.200/24 in the JSON model. |
| Detection | Full observed-state comparison failed; management invariance was violated. |
| Immediate acceptance | Rejected; the failed change was never marked accepted. |
| First recovery case | Original backup bytes were restored and verified equal to the baseline. |
| First disposition | failed_change_restored; final digest again began 4ce1a6f33041. |
| Recovery-mismatch variation | An intentionally incomplete restore produced a different digest, beginning 07ef11f47afb. |
| Second disposition | blocked_recovery_unverified; no acceptance or automatic continuation. |
The completed incident note reads: “The postcheck found management drift introduced by the test. In the first recovery case, restoration returned exactly the starting bytes, so the attempted change remains failed but recovery is verified within the model. In the mismatch variation, the restore write did not restore those bytes. Keep that case blocked, preserve its evidence and investigate the restore path before proposing another change.”
This result distinguishes successful recovery from successful change. It also preserves the unresolved outcome instead of hiding it behind an overall green test report. The harness's assertion passed because it correctly identified the blocked state; the simulated recovery itself failed.
Show the negative cases beside the positive result
The executed suite contains seven cases: accepted change, unchanged second run, stale baseline, wrong target, backup failure, postcheck failure with verified restoration, and restoration mismatch. All seven produced their expected dispositions. All seven cases satisfied their explicit assertions. Only the positive case accepted a model change; the second run was unchanged, and the remaining cases tested refusal, abort or recovery behavior.
The stale-baseline and wrong-target cases performed no candidate write and left the original bytes unchanged. The backup-failure case also stopped before applying the candidate. The normal recovery case returned to the original bytes. The recovery-mismatch case intentionally ended in a different local model and was explicitly blocked; the temporary fixture was subsequently cleaned up.
These cases make the checks consequential. If removing a guard causes the relevant case to fail, the guard is testing a meaningful boundary. A suite that only reruns the successful input cannot show whether the automation refuses stale intent, rejects excessive scope or notices incomplete recovery.
Package evidence so someone else can challenge it
Keep the original harness, the initial model, the declared change and a machine-readable result together. Our report records the Python runtime, execution time, case name, expected disposition, actual disposition, phase events and full before/after hashes. For mutation cases it also preserves the model objects.
A reviewer should be able to trace each sentence in the change memo to an observation. The source file explains how the fault was injected; the result shows what the postcheck detected; the disposition records whether the operation was accepted, rejected, restored or blocked. Keep those meanings stable across the README and résumé description.
The test file's location is not itself evidence that its contents are correct. Preserve the exact version used to generate the report, and document the command and runtime. The executed command was .venv/bin/python outputs/network-automation-portfolio/evidence/mock_change.py from the project root; the report records Python 3.12.14. This experiment used only Python standard-library code and local files. It did not install a network automation framework or silently substitute generated output for an executed run.
Describe the achievement at the level you proved
A supportable portfolio statement is: “Built and executed a local simulated-switch change harness with baseline and scope prechecks, verified backups, observed-state postchecks and recovery verification; seven positive and negative cases produced expected dispositions, including a blocked restoration mismatch.”
Avoid rewriting that as “automated production switch changes with zero downtime.” No live device, traffic measurement, real management connection, concurrent operator or transport failure was tested. The mock also lacks atomic commits, locking, interrupted-process recovery and vendor configuration semantics. Those are concrete next validation gaps, not minor details that a successful file comparison resolves.
Use LandOffer job descriptions to identify which of those gaps matters for a target role. Mark each requested duty as demonstrated here, demonstrated elsewhere or still untested. Present the executed model evidence clearly, then distinguish any separately completed authorized lab or professional work. The recovery record supports a discussion of these decisions; hardware and operational claims still need their own evidence.
Download the worked example files
Download the companion example files. The archive contains the original educational artifacts discussed above. Review its README and source before running code; fictional inputs and local test results retain the limits stated in this article.


