CCNP ENCOR lab 33 of 36

Python, JSON and agentless automation with Ansible

Prepare two routers for automation, then work as Fernhill's first network automation engineer: read and predict a Python script, repair a broken JSON file, fix a Netmiko collection script, and push standard configuration with an agentless Ansible playbook.

Run this lab

It needs Lite: its 3 nodes are set to 3 vCPU and 2,048 MB in total. That fits the free demo too.

In your workspace: Shared, then CCNP ENCOR 350-401 guided labs, then 33 - Python JSON and agentless automation with Ansible

Try it free for 30 minutesRun it on Lite from £3 a day

The free demo needs no card and no email. Every lab plan includes every guided lab.

Level
Intermediate
Time
About 80 minutes
Nodes need
3 vCPU, 2,048 MB
Smallest plan
Lite

The scenario

Fernhill Freight has hired its first network automation engineer: you. Your toolbox is the NOC workstation (NMS) with Python 3, Netmiko, TextFSM and Ansible (with the cisco.ios collection). Your first week's jobs:

  1. Prepare R1 and R2 so tools can log in over SSH.
  2. Prove you can read Python by predicting a script's output.
  3. Repair the VLAN definition file a colleague broke.
  4. Fix the interface-collection script that crashes.
  5. Push the company's standard NTP server and login banner to every router with Ansible.
DeviceInterfaceAddress
R1Gi0/1 (NOC LAN) / Gi0/010.10.50.1/24 / 10.0.12.1/30
R2Gi0/1 (NOC LAN) / Gi0/010.10.50.2/24 / 10.0.12.2/30
NMSeth010.10.50.100/24 (desktop: Applications → System Tools → MATE Terminal)

Automation account on the routers: netops / Fh-Auto-2026 (privilege 15). Files on NMS are in /opt/lab.

Topology: R1, R2 and NMS share the NOC LAN; R1 and R2 are also linked directly.

What you’ll practise

  • Interpret Python variables, lists, dictionaries, loops, functions, f-strings and exceptions
  • Construct valid JSON and find the usual syntax errors
  • Read and fix a Python script that collects data over SSH with Netmiko and TextFSM
  • Run Ansible playbooks with the cisco.ios collection over SSH, and check idempotency
  • Compare agent-based (Puppet, Chef) and agentless (Ansible, Salt SSH) orchestration

The tasks

  1. Prepare the routers for automation
  2. Interpret a Python script
  3. Repair the JSON file
  4. Fix the collection script
  5. Run your first playbook
  6. Push the standards, twice

The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.

Topology and devices

The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.

Topology of Python JSON and agentless automation with Ansible3 nodes and 1 network, 4 links. Every link is listed as text below the diagram.R1R2NMSNOC-LANGi0/0Gi0/0eth0Gi0/1Gi0/1
3 nodes and 1 network, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in Python, JSON and agentless automation with Ansible, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
R1Cisco IOSvvios-adventerprisek9-m.spa.159-3.m91 vCPU, 512 MB
R2Cisco IOSvvios-adventerprisek9-m.spa.159-3.m91 vCPU, 512 MB
NMSEVE-NG GUI server (Docker)eve-gui-server:latest1 vCPU, 1,024 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder CCNP ENCOR 350-401 guided labs.

  3. Open 33 - Python JSON and agentless automation with Ansible and start its nodes, then open Lab Tasks for the scenario and the steps.

The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.

More CCNP ENCOR labs

All CCNP ENCOR labs

Related labs in other courses

CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.