Review #1: ten network automation labs in two weeks

FREE REVIEW · NOVEMBER 9–22

Ten labs went live on 4NetOps in the last two weeks, across six tracks. This review puts them side by side: what each one built, the idea worth keeping, twelve questions to test yourself and where every track goes next.

LABS

10 labs · 6 tracks

TIME

30–40 min

FORMAT

Recap + 12 questions

YOU WILL END WITH

A clear next step on every track

Exam blueprint · 350-901 AUTOCOR v2.0: 1.1 Construct a network automation solution with Ansible · 1.2 Construct a network automation solution with Terraform · 1.3 RESTCONF solution from a YANG model · 1.4 Python-based automation · 2.2 Diagnose a CI/CD pipeline failure · 2.4 Construct a network simulation with CML · Protocol · 350-401 ENCOR v1.2: 3.3.c Configure first hop redundancy protocols

Jump to: How to use this review · Labs by track · Review questions · Go deeper · Next steps · References

Before you start: how to use this review

Each lab solved one problem with one tool, but the six tracks share a pattern. A control node reaches Cisco devices over a management network, you describe the result you want in a file, a tool turns that file into commands or API calls, and a final check proves the device ended up as described.

Read the table to see where each lab fits, then answer the questions without opening the labs. If an answer surprises you, the link in the table takes you back to the lab that explains it.

Four steps repeat in every lab, whatever the tool.

1 · REACH

192.0.2.0/24

The management network: SSH, HTTPS or NETCONF from the control node.

→

2 · DESCRIBE

YAML · HCL · Dockerfile

The state you want lives in files, not in a terminal history.

→

3 · APPLY

playbook · apply · run

ansible-playbook, terraform apply, docker run or pyats parse.

→

4 · RESULT

A check you can repeat

wait_for, assert, a plan with no changes or structured JSON.

By the end you will know which ideas you already master and which lab to reopen before moving on.

SECTION 1 · THE LABS

What you built, track by track

Each track opens with a free lab; the premium labs build on it with the same topology and the same files. Labs are listed in track order.

LAB

WHAT YOU BUILT

IDEA TO KEEP

LAB-PY-001

Free · Python & RESTCONF

RESTCONF enabled on R1 and a Python script that reads its hostname and GigabitEthernet1 as JSON.

Every YANG node has an address under /restconf/data.

LAB-ANS-001

Free · Ansible

A first playbook that runs two show commands on R1 and checks the output with wait_for.

Network modules run on the control node; the router only needs SSH.

LAB-ANS-002

Premium · Ansible

A three-router inventory with groups, group_vars and host_vars.

The most specific variable wins: host beats group, group beats all.

LAB-PYA-001

Free · pyATS

A testbed for R1 and show ip interface brief turned into JSON with pyats parse.

The os field and the command choose the Genie parser.

LAB-TF-001

Free · Terraform

Loopback100 created on R1 over NETCONF with init, plan and apply.

The plan compares code, state and device before anything changes.

LAB-TF-002

Premium · Terraform

Variables, outputs and one for_each resource managing R1, R2 and R3.

for_each keys each instance by name, so removing one router touches only that router.

LAB-INF-001

Free · Infra in Practice

VLAN 10, SVIs and an HSRP group on two IOSvL2 switches, then a real failover.

With state: merged, a second run must report changed=0.

LAB-INF-002

Premium · Infra in Practice

Interface tracking, preempt delay and MD5 authentication, with the key kept in Ansible Vault.

A decrement only moves the role if it drops below the peer and the peer can preempt.

LAB-DKR-001

Free · Docker

Docker Engine on Ubuntu and a RESTCONF check run from a python:3.13-slim container.

The image is read-only; what a container installs disappears with --rm.

LAB-DKR-002

Premium · Docker

Your own netcheck image with pinned requests and netmiko, tagged 1.0 and 1.1.

Copy requirements.txt before the code to keep the pip layer cached.

REVIEW QUESTIONS · 12 QUESTIONS

Read it like the exam

Two questions per track. Answer first, then read the explanation.

1. RESTCONF · You want only R1’s hostname, as JSON. Which URI and which Accept header do you use?

GET https://192.0.2.11/restconf/data/Cisco-IOS-XE-native:native/hostname with Accept: application/yang-data+json. The path follows the model: module name, container, leaf.

2. RESTCONF · How does a URI select one entry of a YANG list, such as a single interface?

With = and the key after the list name: ietf-interfaces:interfaces/interface=GigabitEthernet1. A key that contains / is percent-encoded as %2F.

3. Ansible · ansible_user is set in group_vars/all.yml and, with another value, in host_vars/R3.yml. Which one does R3 use?

The one in host_vars/R3.yml. Host variables beat group variables, child groups beat parent groups, and every group beats all.

4. Ansible · What has to be installed on R1 for the ios_command task of LAB-ANS-001 to work?

Nothing beyond SSH access. With network_cli, the module runs on the control node, opens an SSH session and sends the commands the way you would.

5. pyATS · Which two inputs decide which Genie parser pyats parse uses?

The device os in the testbed and the command itself. A wrong os loads the wrong platform plugin, and the parser for that command may not be found.

6. pyATS · Why parse show ip interface brief instead of matching it with a regular expression?

The parser returns a dictionary keyed by interface name, with fields such as ip_address, status and protocol defined by a schema. Your code reads keys, so it does not break when spacing or column widths change.

7. Terraform · Someone changes, in the CLI, an attribute of Loopback100 that your code sets. What does the next terraform plan show?

An update in place, marked ~: Plan: 0 to add, 1 to change, 0 to destroy. The plan reads R1 over NETCONF, finds the drift and proposes to bring the device back to the code.

8. Terraform · Which file must you commit so that everyone runs the same provider version, and which command writes it?

.terraform.lock.hcl, written by terraform init with the selected version and its checksums.

9. HSRP · DSW1 has priority 110 and preempt; DSW2 has 100. DSW1 reloads and comes back. Who is Active a few seconds later?

DSW1. DSW2 takes over during the reload; when DSW1 returns, preempt lets its higher priority take the role back. Without preempt, DSW2 would stay Active.

10. HSRP · DSW1 (110) tracks its uplink and DSW2 (100) can preempt. What is the smallest decrement that moves the Active role when the uplink fails?

11. The priority must fall below 100, so 110 − 11 = 99 works and 10 does not. LAB-INF-002 uses 20 to leave a margin.

11. Docker · You pip install a library inside a container started with --rm, then start a new container from the same image. Is the library there?

No. pip wrote to the writable layer of the first container, which was deleted with it. To keep the library, build it into an image with a Dockerfile, as LAB-DKR-002 does.

12. Docker · The image has ENTRYPOINT ["python", "netcheck.py"] and CMD ["192.0.2.11"]. What does docker run netcheck:1.1 192.0.2.12 192.0.2.13 run?

python netcheck.py 192.0.2.12 192.0.2.13. Arguments after the image name replace CMD; the ENTRYPOINT stays.

WHAT COMES NEXT

The next step on every track

Every next lab is premium and starts exactly where the previous one ended. Each card in Learning Paths opens the lab as soon as it goes live.

TRACK

WHAT YOU WILL DO NEXT

Python & RESTCONF

LAB-PY-002 · Premium

Discover the YANG models R1 supports, read its YANG library and turn a CLI command into a RESTCONF URI.

Ansible

LAB-ANS-003 · Premium

Collect structured facts from R1, R2 and R3 with cisco.ios.ios_facts and turn them into a report per router.

pyATS

LAB-PYA-002 · Premium

Extend the testbed to R1, R2 and R3 and verify access to each router.

Terraform

LAB-TF-003 · Premium

Open terraform.tfstate, use terraform state list and state show, and watch the plan catch a change made by hand.

Infra in Practice

LAB-INF-003 · Premium

Build VLANs, trunks and SVIs on both distribution switches from one YAML source.

Docker

LAB-DKR-003 · Premium

Reach 192.0.2.0/24 with a bridge or host network, mount the inventory and keep running-config backups in a named volume.

NEXT REVIEW · DECEMBER 6

Keep the rhythm

A new lab goes live almost every day. The next review gathers the labs from November 23 to December 6 and brings twelve new questions.