Network Automation with Python and Ansible

Course Overview

This class is designed as an introduction to Software Defined Networking, Python programming, and Ansible. The first day is an introduction to Software Defined Networking, understanding Python’s potential places within your next-generation network, lecture concludes with learning to install Python and work within the Python interactive environment. Days two through four are heavy on learning to write Python, highly effective functions, and the basics of object-oriented programming. Day four concludes with an introduction to Ansible, which continues on day five. The course is 50% lecture and 50% hands-on labs. Students need no prior knowledge of any of these topics, although some prior exposure to networking or programming is helpful.

python course cover image

Course Outline: Network Automation with Python and Ansible

5 Days with Hands-on Labs and Full Course Video


1. SDN Introduction

  • Data Plane
  • Distributed Control Plane
  • Interfacing with the Distributed Control Plane
  • Problems with Distributed Control Plane
  • Clean Interface for new Applications
  • Clean Interface for new Applications
  • What about the Southbound Interface?

 2. SDN and Python

  • RYU Controller
  • Network Function Virtualization Introduction
  • Tools for Abstracting NFV Complexities
  • Deploying Controllers and Topologies with Python
  • Performance Modeling Topology Modifications

 3. Introduction to Python

  • Introduction to Python
  • Installing Python
  • Installing Python 3.x
  • Preparing to write Python files
  • Python Enhancement Proposal (PEP)
  • Python Statements and Control Flow

 4. Basics of Python Programming

  • Basics of Python Programming
  • Syntax
  • Print
  • Escape Sequences

 5. Python Basic Variables and Data Types

  • Python Basic Variables and Data Types
  • Using the Interactive Shell
  • Expressions
  • Variables
  • Variable Types
  • Operators
  • Math Functions
  • Strings
  • Boolean
  • Data Structure

 6. Python Input & Output

  • Python Input & Output
  • Formatting
  • Output to File
  • Collecting User Input

 7. Python if Statements

  • Python if Statements
  • Operators
  • Operators
  • Operators
  • if
  • else
  • elif
  • Nested if

 8. While Loops

  • While Loops
  • Flow
  • Example
  • Events
  • Continue
  • Break
  • File Read Write

 9. Python for Loops

  • Python for Loops
  • Flow
  • Examples
  • range
  • tuples and lists
  • dictionaries
  • while vs if

10. Python Iterators

  • Python Iterators
  • Iterator vs iteration
  • Iteration with iter() and next()
  • Iteration with iter() and next()
  • Iterators and Dictionaries
  • Iterating Tuples

 11. Python List Comprehensions

  • Examples
  • Strings
  • List Comprehension with Files

 12. Python Functions

  • Syntax
  • Structure
  • String Processing
  • Multiple Parameters
  • Other Function Types
    • Predicate Functions
    • Predicate Functions
    • Recursive Functions
    • Recursive Functions with Strings
    • Higher order functions
    • Anonymous Functions
    • Filter function

 13. Python Scope

  • Python Scope
  • Names
  • Global
  • Local
  • Nested

 14. Python Importing, Packages, and Modules

  • Python Importing, Packages, and Modules
  • Libraries
  • Import
  • Modules
    • User Defined Modules
    • Importing Functions from User Defined Modules
    • Python Names and Namespaces

 15. Object-Oriented Programming

  • Object-Oriented Programming
  • Data Abstraction
  • Class
    • Defining a Class
    • Object vs Class
    • Class Fields & Constructors
    • Data Structures within a Class
  • Inheritance
    • Class Inheritance
    • Sub Classes (Inheritance)

 16. Python Exception Handling

  • Python Exception Handling
  • Common Errors
  • Exception Handler
  • Exceptions
  • Handler Examples
    • Try, Except, Finally

 17.Regular Expressions

  • Regular Expressions
  • Operators
  • Examples
  • Raw

 18. Data Serialization

  • JSON Standards
  • JSON Examples
  • YAML
  • YAML Dictionary and List
  • YAML Syntax
  • XML
  • CSV
  • JSON

 19. Python Environments and Projects

  • PiPI
  • Lightweight Virtual Environments Using venv
  • Representational State Transfer (REST)
    • Insomnia, cURL, and python -m json.tool
    • etcd

 20. Cisco Conf Parse

  • Basic Tools
    • Intro to Cisco Conf Parse1
    • Parent vs Child lines
    • IOSCfgLine objects
    • Retrieving text from an IOSCfgLine object
    • Example Cisco IOS Config - cisco_a3.conf
  • Basic Steps
    • Finding interface names that match a substring
    • Finding parents with a specific child
    • Finding parents without a specific child
    • Writing a Script with CiscoConfParse

 21. Ansible

  • Introduction
  • Modules
  • Applications
  • Examples
  • Writing a Playbook
  • Troubleshooting
  • Handlers

 

Labs:

01 - Using vim

02 - Linux Networking Basics
03 - Virtual Interfaces
04 - Linux Bridge
05 - Open vSwitch (OVS)
06 - Introduction to Mininet
07 - SDN Topology Analysis using Python

SOLUTIONS - SDN Topology Analysis using Python

08 - Introducing the Controllers (Ryu)
09 - Using Wireshark to Capture OpenFlow v1.3 Traffic
10 - Build a Ryu GUI Topology Viewer with Python
11 - Using 8c Installing Python
12 - The Shebang Line
13 - Using PrintO to understand Input / Output
14 - Using while, if, elif, else

SOLUTIONS - Using while, if, elif, else

15 - Troubleshooting while, if, elif, else
15 - SOLUTIONS - Troubleshooting while, if, elif, else
16 - Program a CIDR to Subnet Mask Calculator

SOLUTIONS - Program a CIDR to Subnet Mask Calculator

17 - Understanding Python Lists
18 - Using for, range, format, if, elif, else
19 - Python - Migrating 2.x programs to 3.x program
20 - Binary String to IP Address Conversion
21 - for loops and range()

SOLUTIONS - for loops and range

22 - Defining Functions

23 - Working with from and import

24 - Writing your own script with if, elif, and else statements

SOLUTIONS - Writing your own script with if, elif, and else statements

25 - Using Python to Create an OpenStack Permissions File
26 - Writing a Python Application to Parse Keystone Log File for Failed Auth Attempts

SOLUTION - Parse Keystone Log File for Failed Auth Attempts

27 - pip - PythdnsPackage Management System

28 - Using Python to get at your Network Interfaces

29 - JSON to YAML Converter, Wireshark, and SIP

30 - RESTful Interfaces with Python and etcd

31 - Construct a SimpleHTTPServer and HTTP Client

32 - Use RegEx to Check Your External IP Address

33 - Use RegEx to Search Text

SOLUTION - Use RegEx to Search Text

34 - Writing a Python Application to Parse SIP Message

35 - Using Python to Search Network Config Files - ciscoconfparse

36 - Ansible 101

36 - Even more Ansible

38 - Ansible API

 

Alta3 Research

Network Automation with Python and Ansible


Duration: 5 Days (instructor-led)

Delivery: Onsite or Instructor-led Virtual

Price:
Onsite: Contact us for group quotes

Course Outline PDF: Download PDF

Buy Self-Paced

Buy Virtual