The 'Why' and the Toolkit
Build a Production-Ready, Portable Network Automation Environment. Learn to create a custom Docker image pre-loaded with Python, Ansible, and all required libraries. Deploy this foundational image to Docker Hub for guaranteed, consistent environments across your team and deployment targets.
Set the Stage for Real-World Automation. Design and provision a realistic, multi-site network topology featuring Cisco CSRs (Active/Standby), switches, and a FortiGate firewall. You'll establish the initial, basic routing configurations, providing a production-grade testing lab for all subsequent automation tasks.
Master the Essential Python for Automation. Quickly acquire the core Python knowledge you need for network tasks: variables, control flow, loops, and object-oriented concepts. This chapter is laser-focused on teaching you just enough Python to immediately transition into hands-on network scripting.
Traditional Automation
Secure CLI Automation with Python. Dive into Paramiko, the foundational Python SSH library. Learn to establish secure, direct connections to network devices. Start with simple scripts and progressively refactor your code into a modular, reusable structure capable of handling multiple devices and complex CLI commands.
Professionalize Your Scripts. Elevate your automation code by creating your first Object-Oriented Python class, Connectivity. This class will contain methods for logging into devices, sending commands, securely receiving output, and handling command-line interactions, turning simple scripts into reliable systems.
Achieve Direct Device Control. Use your new, object-oriented Connectivity class to execute real-world configuration changes. You will configure new subnets on Cisco devices and establish cross-site connectivity, proving the power and reliability of direct Python-based configuration management.
Ansible Mastery
Ansible Fundamentals for Network Engineers. Master the key components of Ansible and write your first effective playbook. Learn how Ansible simplifies repetitive network tasks, dramatically increasing configuration speed and consistency compared to custom Python scripts.
Deploy Consistent Configurations. Use the power of Ansible to perform large-scale configuration deployments across the entire topology. Apply the same networking goals achieved in previous chapters, but now using the declarative, idempotent power of Ansible for reduced configuration complexity.
Standardize Deployments with Jinja2. Unlock advanced configuration management using the Jinja2 templating engine. Separate logic and variables from the configuration text itself, making your automation flexible, reusable, and scalable for massive environments.
Implement End-to-End ZTP. Combine device templates and inventory files to generate complete device configurations. Deploy these files to a TFTP server and provision new devices that automatically pick up their configuration, joining the network with Zero Touch intervention.
Secure Your Automation Pipeline. Protect sensitive data like usernames, passwords, and API keys. Learn how to encrypt these credentials using Ansible Vault, ensuring your automation remains secure and compliant in any production environment.
Modern Network Control
Shift from CLI to Code-Driven APIs. Learn how modern networks are managed via APIs. Use Python's requests library to interact with native Cisco IOS XE REST APIs and explore API endpoints for configuration management. Gain essential skills for managing modern vendor platforms like Fortinet FortiGate through their official APIs.
The Application
Build the Full Stack Web Frontend. Introduce the Django Web Framework. Set up a simple application and master the MVC pattern (Models, Views, Templates) to create the interface for your final project. Learn how to transform your automation scripts into a user-friendly, enterprise-ready web application.
Design the Full Stack Automation Engine. Architect and build the core skeleton of your final Zero Touch Provisioning (ZTP) Django application. Make critical design decisions on models, database utilization (SQLite), user interaction, and dependency management to ensure a robust, scalable system.
Deployment and Validation. Bring all components together: Python, Ansible, Jinja2, Docker, and Django. Finalize the full-stack web application, perform comprehensive testing, and prepare your production-ready, browser-based ZTP tool for deployment.