Learning Path: Automation with Ansible, Puppet, and Salt
4.1 (866 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
7,765 students enrolled

Learning Path: Automation with Ansible, Puppet, and Salt

Use popular automation tools for a scalable, reliable, and secure IT environment.
4.1 (866 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
7,765 students enrolled
Created by Packt Publishing
Last updated 5/2018
English [Auto]
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 14 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Configure and manage your infrastructure using Ansible Playbooks
  • Create task blocks and choose the right Ansible Strategy for the job
  • Understand the nuances of Ansible 2 and its new features
  • Write efficient, reusable, and modularized Puppet code
  • Write extensive tests for the code and run automated builds using Jenkins Integration
  • Create a pipeline for effective code management
  • Understand Salt’s state system and write and manage complex states
  • Use and react to real-time events across an infrastructure
  • Basic idea of system administration and Linux systems
  • Workstation with Vagrant and VirtualBox installed

It is no surprise that automation and orchestration make life very easy, be it a small organization or a large-scale industry that houses hundreds of servers. IT automation is essentially the ability to orchestrate and integrate tools, people, and processes through a certain workflow. Automation with Ansible, Puppet, and Salt is a Learning Path that looks at the most popular tools for automation, their advantages, and how you can use each of these tools to automate your IT infrastructure effectively.

Packt’s Video Learning Paths are a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.

In this one, we'll cover the why and how of Ansible, Puppet, and Salt, in a step-by-step, progressive manner. Initially, we focus on Ansible. You will learn how to manage environments and implement strategies in Ansible and be introduced to Ansible Galaxy and Tower, which are Ansible's enterprise tooling for supporting large-scale infrastructure. We then move on to learning Puppet. Puppet is a configuration management tool that allows you to automate all your IT configurations. Using Puppet you can control each Puppet agent in a network. You will learn how to do so by first understanding the Puppet ecosystem and then detailed topics such as configuration and management of Puppet servers, environments, module repositories, and reusable modules. With Salt too, we use a similar approach. We start from the basics, such as installing, configuring, deploying, and managing a web application to advanced concepts like Docker containers across multiple systems behind a HAProxy load balancer.

By the end of this Learning Path, you will be able to build and manage your infrastructure and fully utilize its potential.

This course is authored by some of the best instructors in this field:

David Cohen worked as a system administrator, platform engineer, DevOps engineer, and software developer in everything from small businesses to growing companies (100+ employees) and large tech/engineering firms (10,000+ employees). He owns a YouTube channel, where he has helped tens of thousands of people learn the basics (and not-so-basics) of system administration, DevOps, and software engineering.

Anirban Saha is an infrastructure professional with more than six and half years' experience in infrastructure management at various industries and organizations ranging from early startups to corporate environments. He has worked extensively with configuration management and automation tools including Puppet, Chef, Ansible, Saltstack, and Terraform, to name a few.

Seth House is an active member of the Salt community for the past five years and has worked at SaltStack for four years. He wrote the salt-api and also contributed to many core parts of Salt. He has collaborated with the Salt community and started the Salt Formulas organization.

Who this course is for:
  • This course is ideal for system administration and IT professionals who are looking at automating their organization’s infrastructure.
Course content
Expand all 95 lectures 13:55:42
+ Ansible 2 for Beginners
33 lectures 04:16:34
This video provides an overview of the entire course.
Preview 04:25
In this section, you'll learn about the most popular uses of the Ansible automation tool. It's a tool that you can use to manage the full life cycle of your infrastructure.
What Is Ansible?
Ansible is more than just configuration management, like many other tools in this space. It's also much more lightweight than competitors like Puppet and Chef—to configure a server, all you need is an SSH login and Python 2 installed.
Why Ansible?
We'll use a simple example: installing and configuring an nginx server and a simple static HTML website, first using bash and then using Ansible.
Demonstration – From Bash to Ansible
This video gives you an overview of how the course is structured. The focus is on practical, real-world applications, since that prepares you for real-life application of this knowledge.
Course Layout

In this video, we'll cover the basic Ansible vocabulary. You'll have many basic questions answered.

Basic Ansible Vocabulary
In this video, you'll learn about the new features and improvements that Ansible 2.0 offers.
New Features in Ansible 2.0

In this video, we'll set up an environment that you can use to safely practice everything you see in this course.

Preview 03:02
In this video, you'll learn the three most popular ways to install Ansible, and decide which one is right for you.
Installing Ansible
In this video, we'll cover how to build Ansible directly from its repository. This method is useful if you absolutely need a bleeding-edge feature, or if you're interested in contributing to the Ansible source code.
Bleeding-Edge Ansible Installation
In this video you'll learn how to simulate test machines with LXC (Linux Containers). LXC is a lightweight precursor to Docker which will let us configure some test hosts that we can run Ansible against.
Setting up our Test Environment
Ansible only requires two things: Python 2 and a running SSH service. In this video, I'll show you the 10-second process that prepares a brand-new host for Ansible.
Target Machine Requirements
In this video, you'll learn where Ansible looks for its primary configuration file, and the different ways in which you can approach configuring Ansible.
Preview 05:16
How does Ansible know which hosts to configure? The Ansible Hosts (Inventory) file!
Ansible Hosts Inventory File
Ad-Hoc Commands are simple one-off commands that perform a single action on a target host. These simple replacements for small bash scripts or 'for' loops are run from the command-line, and work well for cases where a full-featured Playbook is overkill. You'll see Ad-Hoc commands for doing several things across one server, or many servers at once
Ad-Hoc Commands
Playbooks are the Ansible feature you'll be working with on most projects. In this video, you'll learn the three components that make a Playbook what it is: tasks, templates, and handlers.
Introduction top playbooks
In this video, you'll learn how to structure your playbooks for maximum readability, predictability, and flexibility. You'll learn about Roles, and how they can help you reuse code. Note: For this course, we're not using every available Playbook feature, because it can make things excessively complex. We're focusing on the practical 90% of features that you'll be using every day.
Playbook Structure
In this video, you'll learn what Ansible modules are and how they help you get things done.
Introduction to Modules

In this video, you'll learn about some of the most popular (and useful!) Ansible modules. At the end of this video, you'll have a list of modules to dig into, which you can use to manage

Common Modules
In this video, you'll learn about how Ansible deals with Variables and Facts:
Variables and Facts
In this video, you'll see a real-life web application deployment. We'll be setting up Mattermost, an open-source alternative to the popular Slack team-chat application.
Preview 12:02
This video reviews everything we just saw in the application deployment. After watching this video, you'll start to have an intuitive 'real-world' grasp of how a playbook works.
Real-Life Playbook Walkthrough

While developing Ansible automation, you'll be doing a lot of troubleshooting as part of the process. In this video, I'll show you the most common Ansible features that you'll use for debugging, along with some of the most common Ansible errors you'll encounter.

Preview 13:06

In this video, you'll learn about the control flow that you can use in your Tasks and Plays. At the end of this video, you'll be comfortable with Ansible iteration constructs like:

Conditionals and Control Flow
In addition to control flow in your YAML files, we can also introduce control flow for our file content in your Jinja2 templates.
Templating, Control Flow, and Iteration in Jinja2

We have been using YAML to write your Playbooks, Plays, Tasks, and Handlers. Now it's time to dig in for a moment and learn some of the rules you need to keep in mind when working with this markup language.

YAML Basics
Task Blocks are one of the useful new features in Ansible 2.0. They allow you to group related tasks together, so you can tie control-flow to larger chunks of actions. This is something that comes in handy for larger actions which are made up of several tasks.
Ansible Blocks

Ansible has two built-in execution strategies that affect how it applies tasks to hosts. Knowing whether you want to use the linear (default) strategy or the free strategy can make the difference between completing a deployment in minutes or hours

Performance and Execution Strategies

Ansible Galaxy allows you to leverage open-source roles that other people in the Ansible community have created. It can be useful for studying code that others have written, or for quickly getting some functionality that you need without having to write it from scratch.

Ansible Galaxy
In this video, I'll cover some of the basic security features. This is essentially a quick list of "best practices" and "things to watch out for." Using Ansible for provisioning, deployment, configuration management, and orchestration does not absolve you of managing the security of your systems...you'll still have to invest thought and planning into how you do this.
Ansible can be used to provision services on all major cloud providers: Amazon Web Services (AWS), OpenStack, Google Cloud, Microsoft Azure, and more. There are also Ansible modules for on-premise virtualization and cloud solutions, which makes it really easy to get started.
Preview 03:01
In this demonstration, you'll see how the Mattermost Deployment playbook was ported to Amazon AWS.
Ansible AWS Demo
This video will give you a quick taste of Ansible's commercial solution: Ansible Tower. This is a web application wrapper around the core open-source Ansible toolset
Ansible Tower
+ Puppet Essentials for Beginners
23 lectures 03:25:00
This video provides an overview of the entire title.
Preview 04:45
Installation of the required setup and working environment
Installing and Setting Up the Working Environment
To deal with large infrastructures, manage and deploy them, configuration management has become the industry wide accepted solution. We will look at problems addressed by configuration management and the advantages.
Preview 04:57

Before diving deep into learning a technology, it is important that we make ourselves aware of the unique terminologies of the concerned tool. We learn about the most important components and terminologies of Puppet.

Puppet Components and Terminologies
To learn about how to manage infrastructure with a tool, a deep understanding of the workflow of the tool is extremely necessary. We learn about the relation of the Puppet components with each other and how they work together to achieve a managed infrastructure.
Understanding the Puppet Run Cycle
To get started with a tool, it is essential to be able to obtain the software and know how to install them on the system. We learn about installing the Puppet components and explore the directory structure of Puppet to know what lies where.
Installing the Puppet Components
After obtaining the required tools, the procedure to make the components work with each other is necessary to master. We learn to create basic content on the Puppet server and make the agents get them after successful authentication.
Puppet in Action
To use a running Puppet infrastructure, it is important to be able to add meaningful content to it so that agents are able to get more and more functionalities. We learn about modules and their structure. We also learn to add features to modules to make them applicable to a diverse infrastructure.
Overview of the Puppet Language

While default settings are enough for a small infrastructure, often parameters need to be tweaked to get optimal performance as infrastructures scale. We learn to change parameters to suit our needs and manage certificates on the Puppet server.

Preview 09:42
With an ever growing community, there has been a trend in creating community modules which can be used by users and organizations without having to write new modules themselves. We learn about community modules, where to find them and how to contribute.
Introduction to Community Modules
When using community modules or a module with loads of dependent modules or classes, all the dependencies need to be mentioned in the module specifically and need to be present on the system during various phases such as Puppet agent runs or testing. We learn to manage these modules.
Managing Module Dependencies and librarian-puppet
Keeping all modules in a single location has its own disadvantages such as dangers of breaking the module tree when trying to test a new module or a change. Environments can be configured to address this problem. We learn to configure and manage environments.
Managing Environments with r10k
As the functionalities keep getting added to Puppet agent nodes, the list of modules to be included in the node definitions keep increasing. To address this problem and keep node definitions clean and efficient, the concept of roles and profiles is applied
Understanding roles and Profiles
Writing a module has become a complex process as new features and workflows are added each day. With ever increasing list of directories and files in a module, it is necessary that we know the function of each of them. We learn to create and manage a module.
Writing and Managing a Module
One of the recent attempts to create generic modules includes steps to separate logic and data. Hiera enables users to keep data separated from module logic and reuse modules by just changing Hiera data.
Understanding and Using Hiera
Although not seen as mandatory or crucial in module development, test driven development should be adopted and followed by all organizations managing infrastructure using Puppet. We get an overview of Puppet module testing.
Preview 03:58
When writing long and complex modules, it is easy to miss characters or keywords here and there and to not be able to follow style guides. Syntax tests make it easy for developers to find out problems in code files and conform to the standard development style guide.
Testing Puppet Syntax with puppet-lint
The methodology of writing tests first and then writing code to fulfill the tests is widely practiced in the industry for almost all programming languages. Puppet development is no exception. Using rspec-puppet, we learn to write unit tests for Puppet modules.
Writing Unit Tests with rspec-puppet
Once modules are written, it should be tested on a running system and the configured components should be verified before the modules can be pushed to production. The Beaker testing tool helps us to create acceptance tests using Serverspec for Puppet modules.
Writing Tests with Beaker Using Serverspec
To test modules on running systems and verify configured components, there are more than one tool and we have options to choose from. Test-kitchen is another excellent tool which helps us to run acceptance tests using Serverspec.
Writing Tests with test-kitchen Using Serverspec

Being able to publish modules in an automated manner is as important as being able to write and test them. Puppet-blacksmith helps us to create releases and publish modules to Puppet Forge in an automated manner.

Publishing Modules to Puppet Forge with puppet-blacksmith
Being able to run test one by one is fun and easy to do when developing modules. However, to be able to produce production code continuously and efficiently, being able to test the code in an automated fashion is important and can be achieved by a tool such as Jenkins. We learn to use Jenkins to run Puppet test suites.
Configuring and Using Jenkins to Run the Test Suites
After being able to run test suites in Jenkins, controlling the code management workflow is the next important task in the process. Creating a workflow for developers to be able to push new code to production without breaking existing infrastructure is what we will learn here.
Using Jenkins to Create a Code Management Workflow
+ Learning Salt
39 lectures 06:14:08

This video provides an overview of the entire course.

Preview 02:01
The aim of this video is to learn how Salt approaches system management and why it uses the technology that it does.
The Philosophy of Salt
The aim of this video is to learn about how Salt utilizes a technology stack to meet design goals and what that stack is.
How Salt Communicates?
The aim of this video is to learn to install Salt from the official SaltStack repository.
Installing Salt
Configuring Salt

The aim of this video is to learn how Salt's encryption layer works.

Key Acceptance and Encryption
We will explore how to granularly target subsets of an infrastructure.
Preview 10:20
We will talk about execution modules which is a large library of common tasks to query or change a system.
Execution Module Basics
Common Execution Modules
Call from Master or Minions
We will explore the intricacies of Salt's State system.
Preview 06:05
Our First State
Dissect State Functions
We will trace the flow of a State run from the master, to a minion, and then back to the master.
Execution Flow of a State Run
Debugging States

The aim of this video is to explore Salt states as data structure generators.

Preview 05:26
The aim of this video is to take a look at what exactly are re-usable states.
How to Write Reusable States?
The aim of this video is to discuss the best practices for writing states in a clean and maintainable way.
How to Write Maintainable States?

The aim of this video is to know about the pitfalls of Jinja and YAML as well as a couple of tips.

YAML and Jinja Best Practices and Gotchas
The aim of this video is to use Jinja and YAML to create minion specific data.
Configuring States Using Pillar
The aim of this video is to know more about Salt formulas and how to use them.
Learning Salt Formulas
The aim of this video is to learn some tips on how to debug Jinja.
Debugging Jinja

With this video, explore complex multi-file state trees.

Preview 09:48

The aim of this video is to discuss ordering strategies to get the state tree to execute in the desired order.

Defining, Enforcing, and Debugging Execution Orders
The aim of this video is to learn about the requisites that can change the order of a state run dynamically.
Conditional and Branching Logic During a State Run
The aim of this video is to lean about debugging strategies for large state trees.
Debugging a State Run

The aim of this video is to explore how to share data between minions.

Sharing Data between Systems with Salt Mine
With this video, get acquainted on how to execute state runs on a master.
Using Salt Orchestrate to Manage Complex State Runs
The aim of this video is to get to know about salt's event basics.
Preview 05:19

The aim of this video is to know about the custom events.

Sending Custom Events
The aim of this video is to react to events and trigger actions.
Listening to Events and Trigger Actions with Salt's Reactor

The aim of this video is to know about Signal salt from third- party tools using Salt events.

Integrating Salt with External Tools Using Events
The aim of this video is to use Beacon modules to automatically create Salt events in response to system events.
Sending Events Using Beacon Modules
The aim of this video is to Debug the Salt Reactor.
How to Debug the Reactor and Best Practices?
The aim of this video is to learn how to install and configure Salt's REST API.
Preview 13:34
The aim of this video is to explore rest_cherrypy endpoints and features.
Exploring rest_cherrypy
The aim of this video is to Access salt's event bus and shortcuts for common tasks.
More rest_cherrypy Features

The aim of this video is to integrate Salt with external services and systems by exposing webhooks.

Using Salt-API to Integrate with External Systems
The aim of this video is to wrap up the video series and get familiar on the general resources for further study.
Wrapping Up and Further Scope