Ansible 101 by Jeff Geerling - YouTube streaming series

Ansible 101 Header Image

After the incredible response I got from making my Ansible books free for the rest of March to help people learn new automation skills, I tried to think of some other things I could do to help developers who may be experiencing hardship during the coronavirus pandemic and market upheaval.

So I asked on Twitter:

And immediately got a lot of positive feedback. So I kicked off a weekly 1-hour live-streaming series, "Ansible 101 with Jeff Geerling," and recorded 15 one-hour episodes, covering all of Ansible's basic usage, using examples from my book Ansible for DevOps.

Please consider subscribing to my YouTube channel if you like this content and want to be notified when I start a new series!

Each stream is embedded below (or you can view all the videos in this Ansible 101 YouTube Playlist), and below the video is a list of contents or 'chapter markers' linked to that particular topic on YouTube itself. If you watch the videos on YouTube, you can navigate the video by section more easily.

Episode 1 - March 25 - Introduction to Ansible

Contents

00:00:00 - Intro
00:01:47 - Preface and Info about Ansible for DevOps
00:07:51 - Ansible Background
00:17:43 - Installing Ansible
00:20:55 - Connecting to a Server with Ansible
00:26:50 - Using an ansible.cfg file
00:28:57 - Running ad-hoc commands
00:33:36 - Vagrant Intro
00:45:24 - First Ansible Playbook
00:51:47 - Idempotence
00:56:56 - Importance of naming tasks
01:01:18 - Chat questions answered
01:02:56 - Outtro

Episode 2 - April 1 - Ad-hoc tasks and Inventory

Contents

00:00:00 - Intro
00:01:52 - Free books for April
00:05:31 - Intro to ad-hoc commands
00:10:00 - Multi-VM Vagrant configuration
00:20:04 - Multi-host inventory
00:28:53 - ad-hoc orchestration
00:31:16 - Forks and parallelization
00:37:14 - Setup module
00:46:32 - Becoming root with sudo
00:50:01 - ansible-doc CLI docs
00:55:13 - Targeting inventory groups
01:00:25 - Outtro

Episode 3 - April 8 - Introduction to Playbooks

Contents

00:00:00 - Intro
00:04:25 - Questions from last episode
00:08:20 - Multi-host ad-hoc orchestration
00:19:02 - Using different modules ad-hoc
00:24:38 - Intro to Playbooks
00:28:18 - Comparing to shell scripts
00:32:35 - Moving commands into YAML playbooks
00:39:28 - Making playbooks more Ansible-ish
00:53:02 - Running the Apache playbook
00:56:24 - Limiting playbook runs to specific servers
01:00:14 - Outtro

Episode 4 - April 15 - Your first real-world playbook

Contents

00:00 - Intro
04:03 - Questions from last episode
06:58 - It was DNS
07:40 - Ansible content site
09:12 - Our first real-world playbook
22:30 - Adding handlers
24:18 - Installing Java and Solr
40:32 - Checking playbook syntax
41:30 - Running the playbook
45:20 - Testing idempotence
46:00 - Viewing the Solr Dashboard
48:33 - Cowsay quote
49:10 - Outtro

Episode 5 - April 22 - Playbook handlers, environment vars, and variables

Contents

00:00 - Intro
04:25 - Questions from last episode
07:58 - Raspberry Pi K8s cluster
10:00 - Simple Apache playbook
11:33 - Playbook handlers
23:45 - Environment variables
35:43 - Dynamic variable files for multi-OS
48:40 - Ansible facts and setup module
50:48 - Registered variables
54:56 - facter and ohai
56:25 - Preview of Ansible Vault
58:00 - Outtro

Episode 6 - April 29 - Ansible Vault and Roles

Contents

00:00:00 - Intro
00:06:30 - Questions from last episode
00:10:51 - Intro to Ansible Vault
00:14:00 - Encrypting a vars file with Vault
00:17:55 - Decrypt, encrypt, edit, rekey, etc.
00:21:33 - Task features - conditionals and tags
00:25:54 - Blocks
00:27:05 - Chapter 5 Cowsay
00:27:26 - Playbook organization
00:30:05 - Includes and imports
00:35:13 - Caution about dynamic tasks
00:37:18 - Playbook includes
00:39:40 - Node.js playbook example
00:46:06 - Roles
00:51:27 - Options for including Roles
00:52:30 - Real-world flexible role usage
01:00:33 - The Golden Hammer
01:01:12 - Outtro

Episode 7 - May 6 - Ansible Galaxy, ansible-lint, and Molecule testing

Contents

00:00:00 - Start
00:00:20 - Intro
00:05:13 - Questions from last episode
00:10:35 - Ansible Galaxy requirements files
00:15:58 - Mac development playbook
00:17:17 - A new chapter for testing
00:19:15 - The Ansible testing spectrum
00:23:50 - Testing inline in playbooks
00:28:39 - Linting with yamllint
00:34:40 - Check syntax with --syntax-check
00:37:30 - Linting with ansible-lint
00:42:42 - Introduction to Molecule
00:47:23 - Testing a role with Molecule
00:55:52 - Role dev with molecule converge
00:59:15 - Using molecule login
01:00:54 - Other molecule commands
01:02:12 - Outtro

Episode 8 - May 13 - Testing Ansible playbooks with Molecule and GitHub Actions for CI

Contents

00:00:00 - Start
00:00:09 - Intro and 10K subscribers!
00:05:54 - Questions from last episode
00:11:13 - Ansible for DevOps 1.23
00:13:00 - 60fps streaming is here
00:13:50 - Molecule playbook testing
00:19:34 - Testing systemd services in Docker
00:30:23 - Testing on multiple OS distros
00:34:00 - Molecule verifiers
00:38:53 - Molecule and testinfra
00:40:20 - Linting with Molecule
00:43:39 - Playbooks in a GitHub repo
00:45:37 - GitHub Actions
00:48:32 - Molecule job in GitHub Actions
00:54:33 - Improving Molecule output in CI
00:58:35 - Demonstration of failing CI
01:00:43 - Summary of Ansible testing spectrum
01:01:56 - Outtro

Episode 9 - May 20 - First 5 minutes server security with Ansible

Contents

00:00:00 - Start
00:00:35 - Intro
00:04:26 - Questions from last episode
00:07:42 - Linux security setup with Ansible
00:09:50 - 9 Basic security measures
00:12:54 - Use secure encrypted communications
00:16:10 - History of SSH (rlogin, telnet)
00:19:38 - Securing SSH
00:23:50 - Ansible SSH security playbook
00:37:29 - Managing users and sudoers
00:43:40 - Remove unused apps
00:46:09 - Principle of least privilege
00:47:30 - POSIX file permissions
00:51:00 - Automatic updates with Ansible
00:54:59 - Configuring a firewall with Ansible
00:59:40 - Oops - locked myself out
01:00:37 - Security role on Galaxy
01:01:52 - Other security concerns
01:03:16 - Outtro

Episode 10 - May 27 - Ansible Tower and AWX

Contents

00:00 - Start
00:35 - Spaaaaaace!
03:29 - Intro
04:51 - Questions from last episode
11:13 - Intro to Tower and AWX
15:00 - How to install Tower or AWX
21:28 - Running the Demo Job Template
22:19 - Adding a playbook to Tower
27:50 - Using Galaxy roles and collections
29:58 - Add a credential to Tower
33:21 - Add an inventory to Tower
36:15 - Add a git project to Tower
38:23 - Add a job template to Tower
41:01 - Using Galaxy requirements in Tower
44:20 - Failure to launch
50:52 - Tower Dashboard and other parts
54:51 - Jenkins section in book
56:28 - Outtro
58:54 - Someone fell upstairs

Episode 11 - June 3 - Dynamic Inventory and Smart Inventory

Contents

00:00:00 - Start
00:00:22 - Intro
00:09:00 - What broke last episode?
00:11:24 - Questions from last episode
00:20:00 - Inventory group_vars and host_vars
00:24:32 - Building dynamic inventory in PHP
00:26:47 - Use ansible-inventory CLI
00:33:44 - Python dynamic inventory example
00:38:30 - Using inventory plugins
00:41:04 - AWS inventory plugin demo
00:48:32 - Dynamic inventory in Ansible Tower
00:55:20 - More advanced inventory examples
00:58:58 - Answering live chat questions
01:02:06 - Outtro

Episode 12 - June 10 - Real-world Ansible Playbooks

Contents

00:00:00 - Start
00:00:29 - Intro
00:07:03 - Questions from previous episode
00:14:55 - My real-world LAMP playbooks
00:26:09 - Complexity vs Simplicity
00:28:24 - Deploying Apps behind Load Balancer
00:40:15 - Capistrano and Ansistrano deployments
00:43:05 - Multi-server zero-downtime deployments
00:53:18 - Serial and max fail percentage
00:54:46 - A word on dependencies
00:56:26 - Introducing Collections
00:57:00 - Outtro

Episode 13 - June 17 - Ansible Collections and a Test Plugin

Contents

00:00:00 - Start
00:00:28 - Intro
00:02:52 - Questions from previous episode
00:08:23 - Intro Collections and new chapter
00:09:42 - History of Ansible Collections
00:20:01 - Creating a Test Plugin with Python
00:37:13 - Creating a collection
00:41:46 - Moving our plugin into the collection
00:43:00 - Using the FQCN
00:46:37 - Collections on Ansible Galaxy
00:48:08 - Installing collections from Galaxy
00:52:55 - Other Collection features
01:00:50 - Outtro

Episode 14 - June 24 - Ansible and Windows

Contents

00:00 - Start
00:20 - Intro
03:38 - Jeff's Windows Background
06:32 - Windows Update
07:30 - Install WSL2 and Ansible
17:13 - Vagrant and Ansible with WSL2
32:45 - Manage Windows with Ansible
33:54 - Set up OpenSSH on Windows
40:38 - Talking to myself
41:01 - Ansible Windows Modules
45:47 - Ansible Windows Collection
49:54 - Ansible 101 series discussion
52:23 - Call for questions for final episode
56:24 - Outtro

Episode 15 - July 1 - FINAL episode with live Q&A

Contents

00:00:00 - Start
00:00:08 - Intro
00:04:46 - Ansible 101 retrospective
00:17:00 - Ansible best practices
00:19:40 - Bootstrapping computers with Ansible
00:22:48 - Ansible for Kubernetes
00:24:56 - Where to store variables
00:26:44 - Running Ansible in CI/CD and Docker
00:29:14 - Monorepo vs many repos for automation
00:31:28 - Organizing tasks for apps vs implementations
00:33:51 - SSH forwarding or proxying in VMware
00:35:38 - Managing isolated servers in DMZ
00:36:28 - Writing tasks based on facts
00:40:10 - Installing AWX in Kubernetes
00:42:50 - When shouldn't Ansible be used
00:45:05 - WinRM through multiple Linux bastions
00:45:51 - Multi-host Molecule testing
00:48:24 - Managing SSH users and keys
00:49:43 - Running roles on specific hosts
00:52:36 - Organizing playbooks - blocks, tags, environments
00:55:23 - Visualizing Ansible playbooks
00:58:31 - Connecting through multiple SSH bastions
00:59:32 - Templating filenames with Jinja
01:00:44 - Better output for debugging
01:02:35 - Jeff's pivot from PHP to Python, Ansible, K8s
01:05:05 - Contributing to Ansible
01:06:31 - AWX or Tower on a Raspberry Pi 4
01:09:20 - Ansible with GitLab CI
01:11:43 - Using 'block' in playbooks
01:12:37 - Building Ansible modules
01:14:33 - Book giveaway
01:16:08 - What's next?
01:18:32 - Outtro

Comments

Once of the best and generous effort particularly in this time. Can't appreciate more.

Thank you Jeff, for your good did, support education and save the world. That is what you are doing. Saving millions maybe. Thank you again.

Hi Jeff, kudos for the work. I would love to see similar sessions for Kubernetes with Ansible. Any thoughts on that?