Webinar Management System

Ansible online course

Home » Webinars » Ansible online course

26:12 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

2:57 Additional resources

Create a Simple Ansible Test Environment 445K 2017-08-10
Errata 200K 2017-02-16
Sample Ansible-based network automation solutions
Full-blown VLAN-as-a-service solution
Deploying Ansible in Production 2:57 2017-07-02

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

More hands-on exercises

Additional and contributed hands-on exercises

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:41:06 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 17:59 2017-07-14
Loops in Ansible Playbooks 11:11 2017-06-06
Tracking Changes in Ansible Playbooks 13:21 2017-07-25
Using Check Mode for Dry Runs 11:49 2017-07-25
Exotic Jinja2 Filters 10:41 2017-06-06

Additional resources

Review questions and Hands-On Challenges 227K 2017-07-25
Slide deck 2.7M 2017-06-27
Source code for examples used in this section

1:38:12 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 11:10 2017-06-27
Connecting and Authenticating to Network Devices 15:20 2017-06-27
Executing Commands on Routers and Switches 23:23 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

33:28 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 12:36 2017-07-02
Task Includes and Loops 6:47 2017-07-02
Ansible Roles 14:05 2017-07-02

Additional resources

Review Questions 156K 2017-07-12
Slide deck 1.9M 2017-03-07
Sample playbooks for Ansible 'include' functionality
Ansible roles examples

Further reading

Using Ansible roles to manage large-scale infrastructure

49:24 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 9:13 2017-06-30
Dynamic Inventory and Hosts 10:15 2017-06-30
Callback Plugins 9:05 2017-06-30
Jinja2 Filters and Tests 20:51 2017-06-30

Additional resources

Review Questions and Hands-On Exercises 167K 2017-07-13
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

47:09 Sample Ansible Playbooks

This section contains sample Ansible playbooks. Every subsection has a video explanation, optional writeup in PDF format, and link to the source code.

15:19 Collect SSH keys from managed devices

Collect SSH Keys 15:19 2017-06-17
Source code for Ansible playbook
VIRL topology used in this example

12:49 Store Device Configurations to Git Repository

Store Device Configurations to Git Repository 12:49 2017-06-17
Source code for Ansible playbook
VIRL topology used in this example

19:01 Generate network topology graph from LLDP neighbor information

Create Network Diagram from LLDP Neighbor Information 19:01 2017-07-14
Source code for Ansible playbooks
Vagrant-based Arista EOS lab used in this example

1:12:41 WAN Services Deployment Case Study

This case study describes WAN services deployment process including:

  • Generating device-focused data model from network-wide infrastructure data model;
  • Validating fabric connectivity with LLDP
  • Configuring OSPF, BGP and MP-BGP
  • Provisioning MPLS/VPN services
Case study introduction 3:14 2017-07-14
Create Device Data Model from Infrastructure Data Model 23:30 2017-07-14

In the data model part of the case study you'll learn:

  • The importance of using network-wide data model when describing your network infrastructure;
  • The benefits of using device-focused data model when creating configuration templates;
  • How to generate YAML data files with Jinja2 templates
  • How to use Ansible playbook to create inventory file and host variables from a network-focused data model
Validate Fabric Connectivity 22:56 2017-07-14

After building the network-centric data model, we'll use it to validate fabric connectivity using information gathered with LLDP. You'll also learn how to translate data models on-the-fly within an Ansible playbook.

Configure and Validate OSPF Routing 23:01 2017-09-03

In the final part of the case study, we'll build OSPF configurations, figure out what changes they would cause on the fabric devices, deploy them, and finally verify that OSPF routing process sees the expected neighbors on fabric links.

Additional resources

Source code for data model and fabric connectivity videos

More Ansible Playbooks

Extract DHCP pools from Cisco IOS routers or switches
Configure DHCP pools and cleanup stale entries
Extract network topology (including network graph) from interface Description-to-Links
Create a fabric data model from interface descriptions
Create and deploy DMVPN configurations on Cisco IOS routers
Deploy approved configurations from Git repository to candidate configurations on network devices
Simple compliance check framework
Create device uptime report from SNMP facts
Transform infrastructure data model into device-focused data model
Configure and verify OSPF neighbors
Configure and verify BGP neighbors
Configure VRFs and VPNv4 address families from list of customer services

Reference: Building a networking automation lab

This section contains links to various documents describing how you can build your own network automation lab using either physical or virtual devices.
Build your Ansible environment in a Vagrant-controller virtual machine 445K 2017-08-10
I would strongly recommend you build your Ansible environment in a virtual machine - the list of dependencies needed to get Ansible and NAPALM running is interestingly long.
Running Ansible in a Vagrant-controlled Virtual Machine
Vagrant uses poorly-documented internal virtual networks. This document describes the various ways of establishing connectivity between Ansible running in a Vagrant-controlled virtual machine and other virtual machines controlled by the Vagrant instance.
Using Ansible playbooks with Cisco VIRL
If you want to test your Ansible playbooks on Cisco's devices I'd strongly recommend using VIRL. This document describes the VIRL setup needed to expose the VIRL management network to outside VMs and the Ansible configuration needed to make Ansible playbooks work.
Create Ansible Inventory Files from Vagrant SSH Configuration
This simple tool creates Ansible inventory files from Vagrant port forwarding printouts and supports running Ansible on the host or in a Vagrant-controlled VM. Highly recommended when running Vagrant with VirtualBox.

Sample Vagrant-based topologies

Vagrant-controlled Ansible VM used with VIRL
Vagrant-controlled Ansible and Juniper vSRX VMs used with VIRL
Arista vEOS leaf-and-spine topology
This section contains a collection of links you might find useful when building your own lab in a non-standard way. Note: you're on your own ;)
Creating your own IOS-XR Vagrant box
Building your own CSR1000v Vagrant box

25:20 Reference: What is network automation

What is network automation and what are the common caveats and roadblock? Spend half an hour to find out.
What is Network Automation 18:08 2017-02-06
Network Automation Roadblocks 7:12 2017-02-06

1:08:49 Reference: Hierarchy of Network Automation

What should you automate in your network? How can you move from a device-by-device approach commonly used in today's networks to a service-oriented network with automated self-service provisioning? This section will give you an overview of what's waiting for you.
Operated Network 12:58 2017-02-06
Abstraction of Network State 12:03 2017-02-06
Automated Provisioning 32:13 2017-02-06
Automated Remediation 11:35 2017-02-06

1:23:27 Case Study: Building Data Center Fabrics

Real-life case study presented by Dinesh Dutt (Chief Scientist @ Cumulus Networks) demonstrates how you can use network automation to build and validate a data center fabric.
Challenges of Data Center Fabric Deployments 20:02 2017-08-10
Separate Data from Code 12:56 2017-08-10
Ansible Tips and Tricks 9:19 2017-08-10
Validation 12:51 2017-08-10
Staging and Production 11:10 2017-08-10
Fabric Deployment Demo 17:09 2017-08-10

Additional resources

Slide deck 1.6M 2017-01-24
Source code for examples used in this section

42:29 Case Study: Abstract Everything

In this case study David Barroso (author of NAPALM) explains how to use NAPALM to abstract platform differences and vendor-specific APIs. Last step in his presentation: move from device-by-device view of the network to an infrastructure-and-services data model.
Template Multi-Vendor Deployments 8:52 2017-07-21
Abstract Vendor API 8:42 2017-07-21
Automate Everything 6:35 2017-07-21
Abstract Everything 18:20 2017-07-21

Additional resources

Slide deck 4.1M 2016-11-18
Source code for examples used in this section

Solutions for Hands-On Exercises

Solutions for YAML and JSON Hands-On Exercises 238K 2017-06-27
Solutions for Jinja2 Hands-On Exercises 705K 2017-06-29
Solutions for additional hands-on exercises available on GitHub 1.5K 2017-09-10
You started this section on %started%