Learning paths › Automation
Network Automation: Never Type The Same Change Twice
Python for network operations: structured data, reusable checks, simulated SSH inventory and fixture-backed API workflows. Practise safe change before connecting to an authorised device.
Level: Intermediate · Provider: Vendor-neutral
What you will be able to do
Automate routine network change safely, with a check that proves the result.
- Read and produce structured device data in Python.
- Write a check that fails loudly rather than passing quietly.
- Drive a device over SSH and an API with the same discipline.
Skills
- Python
- Netmiko
- APIs
- Structured data
- Change verification
Courses
- First scripts that configure devices (24 lessons) — The opening module of a Python-and-Netmiko series: a script that logs in and types for you, VLANs created from a loop, the device list kept out of the code, nested loops that put every VLAN on every switch, every running config collected and saved, then the same work handed to Netmiko's driver and a first NAPALM connection that pulls facts. Explanation and understanding checks throughout; three exercises are written for a lab of your own.
- NAPALM: structured data across vendors (24 lessons) — NAPALM read as structured data instead of parsed text — MAC and ARP tables, and BGP neighbour state checked across a topology and reported only where it is wrong — then configuration pushed without logging in and made idempotent, a running config diffed against intent, and the things that separate a production script from a demo: commands and devices moved out of the code, credentials out of the source and stored encrypted, a device that does not answer, and platform detection before per-platform commands. Explanation and checks; four written exercises.
- Concurrency, and the Python types device output returns (24 lessons) — Connecting to many devices at once with a cap on concurrency, then a careful pass through the Python types device output actually returns: objects and the names that label them, integers against floats, conversion between binary, hex and decimal, and the string work that follows — indexing and slicing, case normalised before comparing, whitespace stripped off CLI output, and format placeholders. Explanation and checks; five written exercises.
- Parsing show output and testing conditions (24 lessons) — Getting a value out of show output by splitting a line into fields, finding where a marker starts and handling the case where it is absent, then the conditions that test it — comparison, and, or and not, True and False as names, and what Python treats as empty — and the containers underneath: a list built and indexed, lists nested into a table of devices, sorting and reversing without losing the original, copying without aliasing, and a tuple for a record that must not change. Explanation and checks; four written exercises.
- Readable code, branching and loops (24 lessons) — Branching and looping as a script grows: if and elif deciding from what the device reported, while with break, continue and a loop else, iteration without managing an index, a dictionary walked as keys, values or items, and ranges counted up or down — then values looked up by a name that means something, dictionaries merged and emptied, and finally working code wrapped in a function, with a Netmiko login turned into one reusable call whose arguments are named. Explanation and checks; seven written exercises.
- Build the workstation and the toolchain (24 lessons) — A second series starts by building the workstation: the toolchain's pieces named, the interpreter installed without breaking the system one, the IDE pointed at it, and the working directory a run actually uses — then files, with a saved config treated as program input, the read position moved, the file closed even when code raises, and CSV handled by the csv module so quoted fields and embedded commas survive into a numeric report. Explanation and checks; two written exercises.
- Files, CSV, JSON and pickle (24 lessons) — Worked file assignments and then the first SSH session: a colon-delimited device file solved with splitlines and solved again with csv.reader, a table round-tripped, Python objects persisted with pickle, dump, dumps, load and loads kept straight, an API body decoded only after its status is checked, and nested records flattened to CSV — then the lab is set up and Paramiko connects, with host-key checking separated from user login. Explanation and checks; three written exercises.
- Paramiko: SSH to devices from Python (24 lessons) — Paramiko put to work: a prompted password instead of a hardcoded one, OSPF configured across a list of routers, a Linux shell driven interactively while exec_command keeps stdout and stderr apart, the repeated SSH logic moved into a module that does not connect when imported, a config backup written per device, device waits overlapped on a thread pool, and files moved with SCP — after which Netmiko takes over prompt and paging handling and pushes a reviewed config file. Explanation and checks; two written exercises.
- Netmiko at fleet scale (24 lessons) — Netmiko across a fleet — a connection and its own output per worker, session logs read without leaking secrets, a file transferred to the device filesystem, and an interface enabled only when its admin state parses exactly rather than merely containing the word — then back to loop and list mechanics: a total accumulated across iterations, a loop left early and its else skipped, input read until a sentinel arrives, assignment inside an expression, and when a list is copied against extended in place. Explanation and checks; three written exercises.
- Tuples, sets and dictionaries for device records (24 lessons) — Choosing the container a device record belongs in: a tuple for a fixed group, sets for distinct values and for comparing two collections of addresses, and dictionaries read without risking a KeyError and copied without sharing their nesting — then functions in detail, arguments bound by position or name, a parameter made optional, a value returned rather than printed, any number of positional or named arguments accepted, the LEGB name rule, and what a mutable argument shares. Explanation and checks; three written exercises.
- Exceptions and your first classes (10 lessons) — Ten lessons closing that series: a syntax error told from one raised at runtime, the specific exception caught rather than everything while cleanup still happens, a list of hosts pinged so one failure does not end the run — then a first pass at classes, defining one and creating an instance, initialising its state, sharing a default across every instance, and giving the object a useful printed form. Explanation and checks; two written exercises.
- Plan and build the automation lab (24 lessons) — Planning and standing up the lab a longer series assumes: what the lab actually needs, a hosted vendor sandbox as an alternative, nested virtualization enabled, where the emulator, the Linux VM and the editor each run, a legacy device's SSH accepted, a virtual environment per project and scripts versioned to a remote — then a first read-only Netmiko script, and Paramiko's shell, with the bytes a channel returns decoded, unknown host keys decided on, a key pair used for Linux login, and a loop kept running when one device fails. Explanation and checks; four written exercises.
- Files, formatting and regular expressions (24 lessons) — Files and text in the same series: collected output written one file per command, a config diffed against its golden baseline and published side by side as HTML, then regular expressions compiled once and anchored to a line, run across saved captures and a live SSH response alike — version facts, hostname, licence and users, an interface header with its subcommands, and the default route separated from the statics — closing on the same interface table read first with split and then with one regex, and on address objects that give a prefix its range, mask and membership test. Explanation and checks; five written exercises.
- Addresses, functions, modules and classes (24 lessons) — Moving from scripts to structure: one connection function called for any device, arguments passed by position or keyword, your own module imported without running itself, and a device modelled as a class whose connect and parsing methods reuse the same collector — then the reference behaviour underneath, rebinding told apart from mutation and the shared-reference trap met twice, and finally concurrency: a thread started per device, work submitted to a pool, and an existing command function threaded as it stands. Explanation and checks; eight written exercises.
- CSV inventories, logging and scheduling (24 lessons) — The operational plumbing around a script: an inventory as CSV rows read a dictionary at a time and written back in a fixed column order, real logging routed by severity instead of prints, credentials read from the environment, an email sent when a record reaches ERROR, and a function run on an interval to poll interface state — then results sorted and rendered as a text table, comprehensions, nested data copied without sharing, another program run from Python, and Netmiko waiting for the prompt and answering the questions an image copy asks. Explanation and checks; three written exercises.
- Netmiko, SCP and structured parsing (24 lessons) — Netmiko past the basics — a pattern paired with each command, files put and got over SCP, the session logged for diagnosis, a with block that disconnects, an auth failure told from a timeout, and threading bounded by a pool — then structured parsing with TextFSM templates and Genie, the data formats around it in JSON, YAML and XML, configuration rendered from a Jinja template, and a closing stretch on MCP: a server built with three tools, used to configure a device, extended with a library, and then called from a Python client. Explanation and checks; three written exercises.
- Agents, async and model-driven workflows (24 lessons) — Three strands in one module: model-driven workflows, where output decides the next step and a schema forces the answer's shape, with spans traced to see where the time went, two agents chained, and a Streamlit page over the top; NAPALM's drivers for a show command, a config backup and restore, normalised facts and a commit with a rollback timer; and Nornir coordinating inventory, host filters, labelled results and subtask order — ending as ncclient opens a NETCONF session and retrieves the running datastore. Explanation and checks; three written exercises.
- NETCONF, YANG and RESTCONF (24 lessons) — NETCONF and RESTCONF as two carriers for the same YANG data: edit-config setting a hostname, addressing a keyed list entry and creating then deleting a user, a vendor RPC sent through dispatch, replies pretty-printed and reparsed, and models browsed before a request is built — then RESTCONF over HTTPS, proven in a client first and its status checked, with replace, create, merge and delete each scoped deliberately and the change persisted — closing on a controller's site hierarchy, credentials and discovery, and NX-API switched on. Explanation and checks; four written exercises.
- NX-API, pyATS and Genie (24 lessons) — Three unrelated stretches the source course left adjacent: NX-API on a Nexus switch, parsed as JSON where the field exists and as ASCII where it does not, with config commands submitted and on-box scripting; pyATS and Genie as test structure, a job run through Easypy, devices described in a testbed, a whole feature learned rather than one command, and before-and-after snapshots diffed; then a microcontroller checking a TCP port over Wi-Fi, throughput measured with iperf3, and a small generative-AI page assembled in Streamlit. Explanation and checks; four written exercises.
- A small GenAI app, end to end (1 lesson) — One lesson only, the tail of the generative-AI app the module before it assembles: swapping the model provider behind an interface that does not change. Nothing else is in this course — the application it belongs to is covered in the preceding module. One explanation, one check, one written exercise.
- macOS, Linux and the virtual lab (24 lessons) — Half a Unix primer and half a software-process one: a shell, editor and package manager set up, the interpreter and a Node runtime installed, a hypervisor's mapping of guest to host, the kernel told apart from the shell, and the everyday commands — listing files and reading their metadata, moving around, redirection, vim, grep, interfaces, processes and package updates — then delivery itself, from sequential phases through incremental and risk-reducing approaches to what separates Scrum, XP and feature-driven development. Explanation and checks; three written exercises.
- Agile delivery and Python fundamentals (24 lessons) — What Agile prioritises in a trade-off, where development and operations share delivery, functional separated from nonfunctional testing, and the red, green, refactor cycle — then Python from nothing for an engineer who has none: which interpreter is running, the interactive prompt and print, int, float, str and bool, a list of device names and a dictionary mapping one to its address, a value looked up by key, operator input, if and elif classifying an ACL number by range, loops, file reads, deliberate append against truncate, and a virtual environment. Explanation and checks; one written exercise.
- REST APIs, authentication and requests (24 lessons) — REST from the contract down: what makes an API RESTful, resource against RPC and query styles, events received instead of polled, a request made with curl and a decision about whether to wait for the result, then authentication separated from authorization — credentials in an Authorization header, exchanged for a token, an API key placed on the right header — and create, read, update and delete worked against a demo API, inspected in a request client and driven in a loop; it closes on Git from init through status, branches, a merge conflict and a push to a remote. Explanation and checks; four written exercises.
- Flask, Docker and Jenkins (24 lessons) — A small Flask app containerised and put behind a build server: a URL mapped to a Python function and HTML returned from a template, a Dockerfile written, the image built and run and a shell opened inside the container, then the build server unlocked, plugged into the repository, and expressed as checkout, build and test stages with a downstream job triggered — after which the lab router is reached over SSH from the Linux VM, and YANG is introduced as the shared schema that replaces screen-scraping, rendered as a tree with pyang. Explanation and checks; four written exercises.
- Managing a router with NETCONF and RESTCONF (21 lessons) — One router managed three ways: NETCONF on port 830, from the hello exchange and its capabilities through the server being enabled, sessions checked on the device, and ncclient setting a hostname and adding loopbacks; the same data over RESTCONF, walking the root to an interface and adding a loopback as JSON; and a first Ansible inventory and play that backs up a config and configures IPv6 — then an unrelated closing stretch calling a collaboration platform's APIs to find a person, list spaces and post a message. Explanation and checks; four written exercises.
- Ansible: inventory, ad-hoc commands and first playbooks (24 lessons) — Ansible from the inventory up: an SSH path to the router, an Ansible inventory told apart from /etc/hosts, ansible.cfg kept beside the project it serves, ad-hoc commands run against one switch, a group or everything, and output captured locally one file per device before the pattern is generalised to any show command — then the same work written as a playbook and turned toward changing things, with an OSPF network statement placed under its parent, routers and switches given separate plays, a nested policy configured, and port records looped instead of repeated. Explanation and checks; five written exercises.
- Roles and zero-touch provisioning for Linux switches (24 lessons) — Provisioning Linux-based switches whose configuration is files on the box: agentless change over SSH, push weighed against pull, zero-touch provisioning from DHCP with an SSH key installed on the way, and a project laid out so its dependencies show — then growth into roles, an interface file rendered from a template, a variable traced from the play through to the rendered output, common settings separated from routing into two roles applied to a leaf group, and each leaf's bonds, bridges and SVIs described as data. Explanation and understanding checks only; this course carries no written exercises.
- Installing the controller and applying a project (3 lessons) — Three lessons finishing that Linux-switch build: installing the automation tooling on the controller rather than on the switches, cloning a prepared project and applying it to both leaves, and choosing between a prebuilt appliance and a host you set up yourself. Explanation and checks; two written exercises.
- Setting up Python 3 (2 lessons) — Two lessons and nothing further: choosing a supported Python 3 release to target, and trying expressions at the interactive interpreter. It is the installation note that preceded a longer course, kept as its own row; the Python language itself is taught at length by the other courses in this path.
- The Ansible lab and the controller (24 lessons) — Standing up the control node a longer Ansible series runs from — what the lab must provide, a hosted vendor sandbox instead of local devices, why the controller is Linux rather than Windows, SSH negotiated with an older device, playbooks edited over a remote connection and versioned to a repository — then Ansible itself installed in a virtual environment, the right command picked for the job, defaults set in a project ansible.cfg, hosts and groups named in an inventory, YAML's mappings, sequences and scalars read, a playbook structured into plays and tasks and checked with ansible-lint, and Vault encrypting one secret or a whole variables file. Explanation and checks; four written exercises.
- Vault, variables and config changes (24 lessons) — Where a playbook's values come from and what its changes actually do: the vault password supplied without retyping, variables shared across a group or given to one device, structured facts gathered from an IOS device and printed, a show command waited on for a condition and a prompt answered — then configuration, backed up and diffed before it lands, a line placed inside the right block several levels deep, config lines moved out of the playbook into a file, match strictness and single-line against whole-block replacement, and the resource modules that manage hostname, interface attributes, addressing, VLANs, local accounts and per-VRF static routes as structured data. Explanation and checks; five written exercises.
- Parsing output and knowing which variable wins (24 lessons) — Two things a playbook stops working without. First, human-readable output turned into named fields — with Genie, a community template library, or a TextFSM template of your own. Second, knowing which definition of a variable wins: gathered facts, Ansible's own runtime variables, another host's variables, a play's declared inputs, a file loaded mid-run and a registered task result, with when each is evaluated made explicit — closing on the filters that reshape the result, including a fallback for an undefined value, a mapping overlaid on a base, an attribute projected out of every record, JMESPath and the IP address filters. Explanation and checks; two written exercises.
- Jinja filters and PAN-OS automation (24 lessons) — Jinja and regular expressions inside a playbook, taught against a firewall: encrypted credentials kept in host_vars, address objects and groups read, filtered by name or description and created, a group built from gathered object names, a security rule composed from zones and addresses, and the candidate committed only when something changed — then the templating itself, a first match and then every match with its capture groups, matched text rewritten, config rendered with expressions and loops and composed from smaller files, Jinja placed directly in a task argument, and a variable name resolved at runtime. Explanation and checks; four written exercises.
- Loops, callbacks, strategy and run control (24 lessons) — How a run behaves rather than what it configures: callbacks hooked into play and task events with results sent to a chat channel, a task looped once per item or retried until its condition holds, work restricted by condition, host, tag or limit, the strategy and fork count that stop fast hosts waiting on a slow one, a change predicted without being applied, a task delegated elsewhere or run once — then honest reporting, with failure defined deliberately, change reported truthfully for a read-only command, credentials kept out of logs, a save only when config changed, and a block that recovers through its rescue. Explanation and checks; six written exercises.
- Roles, imports and writing your own module (24 lessons) — Packaging and extending: a role laid out where Ansible will find it and published for installation by version, a task file loaded dynamically or statically with the difference visible in --list-tasks, a role looped or expanded up front, and several playbooks composed into one run — then writing your own module, beginning as a plain Python CSV report, wrapped in AnsibleModule, fed hostvars, and returning a clear failure instead of a traceback — and finally RESTCONF driven through the uri module, with a recorded working request first, PUT's scope seen, routes merged without loss and one loopback deleted by key. Explanation and checks; four written exercises.
- Running playbooks from AWX (3 lessons) — Three lessons on running those same playbooks from AWX: correcting the version mismatches in its install manifests, wiring an inventory, credentials and a project into a job template, and building an execution environment image for the job to run in. Explanation and checks; one written exercise.
Other learning paths
- Cisco CCNA: Wire It, Route It, Secure It
- Visual Modules: The CCNA, Drawn And Narrated
- Juniper JNCIA-Junos: One Candidate Config At A Time
- Arista EOS: Build The Switched Campus, Port By Port
- HPE Aruba AOS-CX: Campus Switching, Routed Both Ways
- Palo Alto PAN-OS: Everything Before You Touch Prod
- Fortinet FortiSwitch: Switching Under The Firewall's Thumb
- Linux For Network Engineers: The Shell Is The Interface
- Cloud Networking: Where The Packet Actually Goes
- Juniper Professional: Past The Associate, Into The Weeds
- Cisco CCNP Enterprise: Where The WAN Actually Lives
- Cisco CCNP Security: Lock Down What’s Already Live
- Cisco CCNP Data Center: Keep The Fabric Breathing
- BGP In Practice: The Protocol The Internet Runs On
- Enterprise Scenarios: Isolate The Fault, Then Defend The Call
- Network Security Engineer: Detect, Triage, Contain