Webinar Management System

Ansible for Networking Engineers

Home » Webinars » Network Automation » Ansible for Networking Engineers

23:15 Introduction

When facing a long study process, it makes sense to start with “what are we doing”, “why are we doing it” and “how is the material structured”. This section will give you these answers, and a procedure you can use to set up a simple Ansible test environment.
Introduction 12:53 2017-05-29
Webinar Structure and More Information 10:22 2017-05-29

Additional resources

Create a Simple Ansible Test Environment 338K 2017-02-16
Errata 200K 2017-02-16
Sample Ansible-based network automation solutions
Full-blown VLAN-as-a-service solution

21:32 Case Study: DMVPN Router Configuration Generation and Deployment

One of the simplest network automation use cases is the automated network generation using unified device templates. We’ll illustrate this concept with a DMVPN deployment case study that runs throughout this webinar and includes data model generation, sample device templates, and configuration deployment with Ansible.
Automated DMVPN Deployment Case Study 2.1M 2015-08-18
Case Study - Introduction 14:27 2015-08-19
Case Study - Network Design 7:05 2015-08-19

47:28 YAML and JSON

YAML is the data presentation language used extensively by Ansible playbooks and variable files. JSON is the presentation language used between Ansible and external components. It obviously makes sense to be familiar with both, and you’ll have to understand the basics of YAML to write your playbooks.
Introduction to YAML and JSON 15:54 2017-03-07
Scalar values in YAML and JSON 8:24 2017-03-07
Simple lists and dictionaries 9:44 2017-03-07
Complex Data Types 13:26 2017-03-07

Additional resources

YAML and JSON Hands-On Exercises 161K 2017-05-15
Slide deck 2.2M 2016-11-17
Source code for YAML Examples
Online YAML validator

26:51 Case Study: Building the Data Model with YAML

The second step in any automated service (or infrastructure) deployment should be a well thought-out data model (the first one should be a service definition). This section describes how you can generate a typical data model, or extract it from sample router configurations, and write it as a series of YAML files that can be used by Ansible playbooks.
Building the Data Model 9:15 2015-08-19
Case Study - Data Model for DMVPN Network 11:26 2016-02-12
Case Study - DMVPN Data Model in YAML 6:10 2015-08-19
Source code for DMVPN case study

1:04:50 Jinja2 - the Templating Tool Used by Ansible

You might think you’d need a templating tool only when generating device (or service or software) configuration from templates. Not true - Ansible uses Jinja2 extensively, from evaluating expressions to specifying conditions, and finally generating text files from templates. Without understanding Jinja2 you’ll have a hard time understanding even moderately complex Ansible playbooks.
Introduction to Jinja2 14:40 2017-03-07
Complex Data Objects and Loops 22:15 2017-03-07
Variables, Macros and Includes 9:59 2017-03-07
Python Methods in Jinja2 6:08 2017-03-07
IP Address Handling 11:48 2017-03-07

Additional resources

Jinja2 Hands-On Exercises 279K 2017-05-15
Slide deck 5.6M 2016-11-17
Source code for Jinja2 Examples
Jinja2 live parser
Dockerfile for Jinja2 renderer script

16:26 Case Study: Creating Device Configurations with Jinja2 Templates

Next step in our case study: after building a data model describing our DMVPN deployment, we’ll create Jinja2 templates that will be used to create device configurations.
Case Study - Preparing Configuration Templates 7:02 2015-08-19
Case Study - DMVPN Configuration Templates in Jinja2 9:24 2015-08-19
Source code for DMVPN case study

1:05:46 Using Ansible

Finally it’s time to get our hands dirty and do some real automation work. You’ll learn about Ansible inventory, authentication mechanisms, Ansible modules, and the basics of Ansible playbooks - just enough to generate device configurations from templates or execute simple commands on network devices.
Introduction to Ansible 23:28 2017-05-29
Ansible Playbooks 22:19 2017-05-29
Generating Configurations from Jinja2 Templates 13:29 2017-05-29
Case Study - Building Router Configurations with Ansible 6:30 2015-08-19

Additional resources

Review questions 198K 2017-05-29
Slide deck 3.2M 2016-12-05
Source code for examples used in this section

1:07:20 Ansible Deeper Dive

Ready for some headier Ansible stuff? Let’s explore the details of Ansible facts and variables, play and task execution (including error handling), implementing loops, working with files, and using exotic Jinja2 filters.
Ansible Variables 19:34 2017-05-29
Play and Task Execution 10:04 2017-05-29
Error Handling in Ansible Playbooks 6:27 2017-05-29
Working with Files 9:23 2017-06-06
Loops in Ansible Playbooks 11:11 2017-06-06
Exotic Jinja2 Filters 10:41 2017-06-06

Additional resources

Review questions and Hands-On Challenges 208K 2017-06-06
Slide deck 2.4M 2017-01-03
Source code for examples used in this section

1:47:48 Ansible Networking Modules - Executing Commands

It’s time to work with real network devices. You’ll learn how to log into network devices, execute commands on them, and get device facts and operational data.
Networking Modules Introduction 12:34 2017-06-19
Connecting and Authenticating to Network Devices 16:45 2017-06-19
Executing Commands on Routers and Switches 30:10 2017-06-19
Simple Command-Based Playbooks 21:39 2017-01-04
Retrieving Device Facts 8:56 2017-01-04
Get JSON Data From Network Devices 11:49 2017-01-04
Use SNMP to Get Device Facts 5:55 2017-01-04

Additional resources

Vagrantfile and VIRL Topology used in this section
Slide deck 3.6M 2017-06-19
Source code for examples used in this section
Network modules debugging and troubleshooting guide

1:03:01 Ansible Networking Modules - Managing Configurations

After managing read-only access to network devices, let’s change device configurations. We’ll cover simple configuration changes, declarative intent modules, and deploying full-blown configuration files.
Managing Network Device Configurations with Ansible 6:43 2017-06-06
Declarative Intent Modules 22:19 2017-06-06
Generic Configuration Changes 19:49 2017-06-06
Deploying Configuration Files 14:10 2017-06-06

Additional resources

Vagrantfile and VIRL Topology used in this section
Review Questions and Hands-On Challenges 247K 2017-06-06
Slide deck 2.5M 2017-01-04
Source code for examples used in this section

47:09 Creating Reusable Code

You want to reuse excellent bits of your code in multiple projects and package them as ready-to-use libraries, right? Let’s dig into playbook- and play-level includes, looping over included modules (which is the closest you can get to subroutine calls in Ansible), and Ansible roles.
Play and Task Includes 15:37 2017-03-07
Task Includes and Loops 8:37 2017-03-07
Ansible Roles 22:55 2017-03-07

Additional resources

Slide deck 1.9M 2017-03-07
Sample playbooks for Ansible 'include' functionality
Ansible roles examples

1:01:37 Extending Ansible

Ansible is a powerful tool, but it shouldn’t be used as a generic-purpose programming language, so don’t try to use it as a Swiss Army Chainsaw - complex tasks should be implemented with a real programming language using Ansible callbacks, modules, external components, or (simplest possible option) Jinja2 filters and tests.
Extending Ansible 10:45 2017-03-07
Dynamic Inventory and Hosts 12:32 2017-03-07
Callback Plugins 12:47 2017-03-07
Jinja2 Filters and Tests 25:33 2017-03-07

Additional resources

Slide deck 1.8M 2017-03-07
Sample Jinja2 filters

1:18:29 Using NAPALM with Ansible

Ansible includes low-level network device modules - you have to use a different module for every vendor or operating system. NAPALM provides an abstraction library that gives you a uniform interface to device configurations, operational data, and even fully-automated device state validation… with an easy-to-use set of Ansible modules.
What Is NAPALM 23:10 2017-05-23
NAPALM Ansible Modules 18:07 2017-05-23
Fully-Automated Verification 15:09 2017-05-23
Hands-On Examples and Playbooks 22:03 2017-05-23

Additional resources

Slide deck 583K 2017-05-21
Source code for examples used in this section

Webinar description

This webinar focuses on Ansible, the configuration management tool most commonly used by network automation professionals. It also describes YAML, the text file format used by Ansible, and Jinja2 templating language.