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.
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. Create a Bookstore Web Application and learn how to Add, Retrieve, Update, and Delete books using Django Templates, Views, Forms, and URLs.
Make your web applications look pretty using CSS Framework - Bootstrap. We will also learn how to install and use Django Crispy Forms to make our forms look great.
Design the Object Model for the application and define relationships between components. Initialize version control by creating a GitHub repository. Implement the first data model, SCP Servers, and build the full stack of Templates, Views, Forms, and URLs necessary to support CRUD (Create, Read, Update, Delete) Operations.
In the last chapter we have set up our project's homepage, and also we added views, URLS, templates, and models for CRUD operations of our DHCPServer Model. In this chapter we will add views, URLs, and templates for addition/update, and delete operations on DHCP Server model.
Here is the expanded chapter overview, suitable for a Table of Contents style summary: Chapter Overview Leverage the power of the Django Admin Interface, one of the framework's most essential "batteries included" features. This chapter guides you through the process of registering your application models with the Admin site. Learn how to use the built-in interface to Create, Read, Update, and Delete (CRUD) objects without writing custom views or forms
This chapter focuses on integrating the user interface with our automation backend. We will develop custom web forms to capture the necessary data for creating an Ansible Inventory (Host) file. The core of the chapter involves connecting these forms directly to the Ansible backend logic we built in Chapter 10, thus completing the Zero Touch Provisioning workflow by enabling users to dynamically generate and execute playbooks based on submitted data.