Learning Path Automation With Ansible Puppet And Salt

Use popular automation tools for a scalable, reliable, and secure IT environment.

Last updated 2022-01-10 | 4.7

- 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

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

* Requirements

* Basic idea of system administration and Linux systems
* Workstation with Vagrant and VirtualBox installed

Description

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

3 sections • 95 lectures

The Course Overview Preview 04:25

This video provides an overview of the entire course.

What Is Ansible? Preview 03:29

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.

Why Ansible? Preview 03:09

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.

Demonstration – From Bash to Ansible Preview 19:28

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.

Course Layout Preview 02:54

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.

Basic Ansible Vocabulary Preview 02:53

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

New Features in Ansible 2.0 Preview 03:30

In this video, you'll learn about the new features and improvements that Ansible 2.0 offers.

Creating an Ansible Home Base Preview 03:02

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

Installing Ansible Preview 05:48

In this video, you'll learn the three most popular ways to install Ansible, and decide which one is right for you.

Bleeding-Edge Ansible Installation Preview 03:28

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.

Setting up our Test Environment Preview 07:33

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.

Target Machine Requirements Preview 03:07

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.

Ansible Configuration Hierarchy Preview 05:16

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.

Ansible Hosts Inventory File Preview 05:19

How does Ansible know which hosts to configure? The Ansible Hosts (Inventory) file!

Ad-Hoc Commands Preview 07:54

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

Introduction top playbooks Preview 19:40

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.

Playbook Structure Preview 11:16

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.

Introduction to Modules Preview 06:01

In this video, you'll learn what Ansible modules are and how they help you get things done.

Common Modules Preview 11:29

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

Variables and Facts Preview 17:55

In this video, you'll learn about how Ansible deals with Variables and Facts:

Real-Life Playbook: Mattermost Deployment Preview 12:02

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.

Real-Life Playbook Walkthrough Preview 14:43

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.

Debugging and Troubleshooting Preview 13:06

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.

Conditionals and Control Flow Preview 04:52

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:

Templating, Control Flow, and Iteration in Jinja2 Preview 07:37

In addition to control flow in your YAML files, we can also introduce control flow for our file content in your Jinja2 templates.

YAML Basics Preview 04:37

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.

Ansible Blocks Preview 03:59

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.

Performance and Execution Strategies Preview 08:10

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

Ansible Galaxy Preview 04:58

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.

Security Preview 04:13

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 in the Cloud Preview 03:01

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.

Ansible AWS Demo Preview 25:10

In this demonstration, you'll see how the Mattermost Deployment playbook was ported to Amazon AWS.

Ansible Tower Preview 02:30

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

The Course Overview Preview 04:45

This video provides an overview of the entire title.

Installing and Setting Up the Working Environment Preview 11:21

Installation of the required setup and working environment

Configuration Management and How Puppet Fits into the Scenario Preview 04:57

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.

Puppet Components and Terminologies Preview 04:58

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.

Understanding the Puppet Run Cycle Preview 03:48

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.

Installing the Puppet Components Preview 06:06

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.

Puppet in Action Preview 08:29

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.

Overview of the Puppet Language Preview 12:47

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.

Puppet Server in Production and Managing Certificates Preview 09:42

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.

Introduction to Community Modules Preview 07:15

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.

Managing Module Dependencies and librarian-puppet Preview 05:21

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 Environments with r10k Preview 14:08

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.

Understanding roles and Profiles Preview 10:04

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

Writing and Managing a Module Preview 12:36

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.

Understanding and Using Hiera Preview 13:37

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.

Overview of Module Testing Preview 03:58

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.

Testing Puppet Syntax with puppet-lint Preview 08:40

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.

Writing Unit Tests with rspec-puppet Preview 16:00

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 Tests with Beaker Using Serverspec Preview 09:38

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 test-kitchen Using Serverspec Preview 09:48

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.

Publishing Modules to Puppet Forge with puppet-blacksmith Preview 06:15

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.

Configuring and Using Jenkins to Run the Test Suites Preview 07:12

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.

Using Jenkins to Create a Code Management Workflow Preview 13:35

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.

The Course Overview Preview 02:01

This video provides an overview of the entire course.

The Philosophy of Salt Preview 02:59

The aim of this video is to learn how Salt approaches system management and why it uses the technology that it does.

How Salt Communicates? Preview 07:14

The aim of this video is to learn about how Salt utilizes a technology stack to meet design goals and what that stack is.

Installing Salt Preview 05:18

The aim of this video is to learn to install Salt from the official SaltStack repository.

Configuring Salt Preview 09:54

Key Acceptance and Encryption Preview 09:10

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

Targeting Minions Preview 10:20

We will explore how to granularly target subsets of an infrastructure.

Execution Module Basics Preview 14:05

We will talk about execution modules which is a large library of common tasks to query or change a system.

Common Execution Modules Preview 16:26

Call from Master or Minions Preview 10:17

The Philosophy of Salt's State System Preview 06:05

We will explore the intricacies of Salt's State system.

Our First State Preview 14:21

Dissect State Functions Preview 11:35

Execution Flow of a State Run Preview 07:12

We will trace the flow of a State run from the master, to a minion, and then back to the master.

Debugging States Preview 05:16

Introduction to YAML, Jinja, and Other Renderers Preview 05:26

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

How to Write Reusable States? Preview 12:35

The aim of this video is to take a look at what exactly are re-usable states.

How to Write Maintainable States? Preview 17:38

The aim of this video is to discuss the best practices for writing states in a clean and maintainable way.

YAML and Jinja Best Practices and Gotchas Preview 05:36

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

Configuring States Using Pillar Preview 20:11

The aim of this video is to use Jinja and YAML to create minion specific data.

Learning Salt Formulas Preview 09:10

The aim of this video is to know more about Salt formulas and how to use them.

Debugging Jinja Preview 05:35

The aim of this video is to learn some tips on how to debug Jinja.

Glue SLS Files Together Preview 09:48

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

Defining, Enforcing, and Debugging Execution Orders Preview 16:14

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

Conditional and Branching Logic During a State Run Preview 13:17

The aim of this video is to learn about the requisites that can change the order of a state run dynamically.

Debugging a State Run Preview 09:54

The aim of this video is to lean about debugging strategies for large state trees.

Sharing Data between Systems with Salt Mine Preview 06:43

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

Using Salt Orchestrate to Manage Complex State Runs Preview 09:00

With this video, get acquainted on how to execute state runs on a master.

An Overview of Salt's Event Bus Preview 05:19

The aim of this video is to get to know about salt's event basics.

Sending Custom Events Preview 06:22

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

Listening to Events and Trigger Actions with Salt's Reactor Preview 12:04

The aim of this video is to react to events and trigger actions.

Integrating Salt with External Tools Using Events Preview 05:33

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

Sending Events Using Beacon Modules Preview 09:45

The aim of this video is to use Beacon modules to automatically create Salt events in response to system events.

How to Debug the Reactor and Best Practices? Preview 04:53

The aim of this video is to Debug the Salt Reactor.

Installing and Configuring Salt-API Preview 13:34

The aim of this video is to learn how to install and configure Salt's REST API.

Exploring rest_cherrypy Preview 14:47

The aim of this video is to explore rest_cherrypy endpoints and features.

More rest_cherrypy Features Preview 15:05

The aim of this video is to Access salt's event bus and shortcuts for common tasks.

Using Salt-API to Integrate with External Systems Preview 10:22

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

Wrapping Up and Further Scope Preview 03:04

The aim of this video is to wrap up the video series and get familiar on the general resources for further study.