Learning paths › Automation › First scripts that configure devices
First scripts that configure devices
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.
Lessons
- What changes when a script does the typing
- Write a script that logs in and types for you
- Run it, then prove the device actually changed
- Create VLANs on a switch from a script
- Repeat work without repeating yourself
- Write code the next engineer can read
- Generate a hundred VLANs from three lines
- Give every device its own management identity
- Keep the device list out of the code
- Walk the inventory and configure each device
- Nest loops: every VLAN on every switch
- Collect and save every running config
- Netmiko: run commands on network hardware from Python
- Turn on SSH so a script can log in
- Open a session and run one command
- Describe each device once, in a list
- Push the same change to every switch
- Drive a change from a command file
- Combine a device list and a command file
- Build one script that configures the whole network
- Run it and verify device by device
- NAPALM: the same call against different vendors
- Install NAPALM and confirm it loaded
- Connect and pull your first facts
More in Automation
- NAPALM: structured data across vendors
- Concurrency, and the Python types device output returns
- Parsing show output and testing conditions
- Readable code, branching and loops
- Build the workstation and the toolchain
- Files, CSV, JSON and pickle
- Paramiko: SSH to devices from Python
- Netmiko at fleet scale
- Tuples, sets and dictionaries for device records
- Exceptions and your first classes
- Plan and build the automation lab
- Files, formatting and regular expressions
- Addresses, functions, modules and classes
- CSV inventories, logging and scheduling
- Netmiko, SCP and structured parsing
- Agents, async and model-driven workflows
- NETCONF, YANG and RESTCONF
- NX-API, pyATS and Genie
- A small GenAI app, end to end
- macOS, Linux and the virtual lab
- Agile delivery and Python fundamentals
- REST APIs, authentication and requests
- Flask, Docker and Jenkins
- Managing a router with NETCONF and RESTCONF
- Ansible: inventory, ad-hoc commands and first playbooks
- Roles and zero-touch provisioning for Linux switches
- Installing the controller and applying a project
- Setting up Python 3
- The Ansible lab and the controller
- Vault, variables and config changes
- Parsing output and knowing which variable wins
- Jinja filters and PAN-OS automation
- Loops, callbacks, strategy and run control
- Roles, imports and writing your own module
- Running playbooks from AWX