
This video will give you an overview about the course.
Whether you're a system administrator, a developer who needs to wrangle servers from time to time, or just someone who's annoyed at how long it takes to deploy a new app, you'll have come across the kind of problems Puppet is designed to solve. Let’s see what Puppet is and how it does that.
The best way to view this course is to follow along with the examples. You can use the popular Vagrant software to run a virtual machine on your computer. The public GitHub repository for this course contains a Vagrantfile, which you can use to get up and running with Puppet in just a few steps.
Let’s begin by writing our first manifest with Puppet, and put Puppet to work configuring a server. We’ll also understand how Puppet compiles and applies a manifest.
A key resource type in Puppet is the package. A major part of configuring servers by hand involves installing packages, so let’s see how we will be using packages in Puppet manifests.
The third most important Puppet resource type is the service: a long running process that either does some continuous kind of work, or waits for requests and then acts on them. Let’s explore services in detail.
In this video, we’ll learn how to use the Git version control system to manage Puppet manifests.
So far we've only applied Puppet manifests to one node, using puppet apply with a local copy of the manifest. Let’s see how we can manage several nodes at once by distributing the Puppet manifests to each node.
In a stand-alone Puppet architecture, each node needs to automatically fetch any changes from the Git repo at regular intervals, and apply them with Puppet. In this video, we’ll explore how to do that.
We saw earlier that Puppet can manage files on a node using the file resource, and we looked at an example which sets the contents of a file to a particular string using the content attribute. Let’s take a look at it again.
We've already seen how to install a package using the package resource, and this is all you need to do with most packages. However, the package resource has a few extra features which may be useful.
Although services are implemented in a number of varied and complicated ways at the operating system level, Puppet does a good job of abstracting away most of this with the service resource.
An important part of system configuration involves creating and managing users, and Puppet's user resource provides a model for doing just that.
Cron is the mechanism on Unix-like systems which runs scheduled jobs, sometimes known as batch jobs, at specified times or intervals. Puppet provides the cron resource for managing scheduled jobs.
While the other resource types we've seen so far (file, package, service, user, ssh_ authorized_key, and cron) have modeled some concrete piece of state on the node, such as a file, the exec resource is a little different. An exec allows you to run any arbitrary command on the node.
A variable in Puppet is simply a way of giving a name to a particular value, which we could then use wherever we would use the literal value.
Variables are not the only things in Puppet that have a value. Expressions also have a value. The simplest expressions are just literal values.
It's very common for Puppet manifests to need to know something about the system they're running on, for example, its hostname, IP address, or operating system version. Puppet's built-in mechanism for getting system information is called Facter, and each piece of information provided by Facter is known as a fact.
Iteration (doing something repeatedly) is a useful technique in your Puppet manifests to avoid lots of duplicated code. Let’s see how we can use that with Puppet.
This video gives an overview of the entire course.
What do we mean by configuration data? There will be lots of pieces of information in your manifests which we can regard as configuration data. Let’ see them in detail.
Let’ see how to use Hiera to store and query configuration Data.
In this video, we'll look at how to write Hiera data sources, including string, array, and hash data Structures.
Now, we’ll see how to interpolate values into Hiera strings using lookup(), including Puppet facts and other Hiera data, and how to duplicate Hiera data structures using alias().
So far, we've only used a single Hiera data source. Actually, you can have as many data sources as you like. Each usually corresponds to a YAML file, and they are listed in the hierarchy section of the hiera.yaml file.
We've seen how to use Hiera data to fill in the title and attributes of resources in the manifest. We can now take this idea one step further and create resources directly from Hiera queries.
Puppet often needs to know your secrets; for example, passwords, private keys, and other credentials need to be configured on the node, and Puppet must have access to this information. Let’s see how to do that.
Although you could write your own manifests for everything you want to manage, you can save yourself a lot of time and effort by using public Puppet modules wherever possible.
Now that we know how to find and install public Puppet modules, let's see how to use them.
One of the oldest-established Puppet Forge modules is puppetlabs/stdlib, the official Puppet standard library. Let's look more closely now and see what the standard library provides and where you might use it.
As we've seen, a Puppet module is a way of grouping together a set of related code and resources that performs some particular task, like managing the Apache web server or dealing with archive files. But how do you actually create a module?
We've come across the class concept a few times so far, without really explaining it. Let's explore a little further now and see how to use this key Puppet language building block.
Whereas a class lets you group together related resources, a defined resource type lets you create new kinds of resources and declare as many instances of them as you like.
Let’s see how to use the classes array in Hiera to include common classes on all nodes, and other classes only on particular nodes.
Now that we know how to include different sets of classes on a given node, depending on the job the node is supposed to do, let's think more about how to name those classes in the most helpful way.
The methods we’ve learnt so far are very useful, but they are limited in one respect: they can only use static text, rather than building the contents of the file dynamically. Let’s see how we can do that with templates.
Since the end result of a template is a file, you won't be surprised that we use Puppet's file resource to work with templates. In fact, we use an attribute of the file resource that you've seen before: the content attribute.
If we can generate parts of a file from Puppet expressions, and also include or exclude parts of the file depending on conditions, could we generate parts of the file with a Puppet loop?
That is to say, could we iterate over an array or hash, generating template content for each element?
Although the technology behind containers is at least thirty years old, it's only in the last few years that containers have really taken off. This is largely thanks to the rise of Docker, a software platform which makes it easier to create and manage containers.
Puppet can certainly install and manage the Docker service for you, just as it can any other software, but it can also do a lot more.
Of course, it's very useful to be able to download and run public images from Docker Hub or other registries, but to unlock the real power of Docker we need to be able to build and manage our own images too.
Although Dockerfiles are a fairly powerful and flexible way of building containers, they are only static text files, and very often you will need to pass information into the container to tell it what to do. We might call such containers—whose configuration is flexible and based on data available at build time—dynamic containers.
There are two ways of persisting data in a container: the first is to mount a directory from the host machine inside the container, known as a host-mounted volume, and the second is to use what's called a Docker volume. We'll look at both of these in this video.
We started off the section by saying that containers are completely self-contained, and have no access to each other, even if they're running on the same host. But to run real applications, we need containers to communicate. Fortunately, there is a way to do this: the Docker network.
If a container can contain a whole operating system, such as Ubuntu, you might be wondering: "can't I just run Puppet inside the container?" Let’s find out.
Before exploring the advantages of cloud computing, perhaps we should define what it is. In the pre-cloud days, if you needed computing power, you bought an actual, physical computer.
But from the customer's point of view, we don't necessarily want a computer: we just want to compute.
Let’s see how to set up a new account and get the credentials you need to start building infrastructure with Puppet.
In this video, we'll see how to generate an SSH key pair to connect to your EC2 instances, and also install the puppetlabs/aws module with its dependencies.
Although you can manage many different types of AWS resources with Puppet, the most important is the EC2 instance. In this video, we'll see how to create your first EC2 instance.
In the previous video, we used the pre-existing default VPC and subnet to create our instance. In production you'll want to use a dedicated VPC for your Puppet-managed resources, to keep it separate from any other resources. You could, for example, have a staging VPC and a production VPC.
There's nothing wrong with managing AWS resources directly in the code, as we've done previously, but we can do just a little bit better. Let’s see how.
It's now time to see how all the ideas from the previous sections fit together. It should be helpful for you to see how a complete Puppet infrastructure works, and you can also use this repo as a basis for your own projects.
You will need to change some of the data and settings in the demo repo to be able to use it yourself. Let’s see how to do that.
If you'd like to try out the demo repo on a Vagrant box, there is a suitable Vagrantfile included within the repo directory.
The challenges of IT infrastructures and the need to automate common activities has become a major requirement in many large organizations. Puppet is one such configuration management tool that allows to efficiently manage and automate all your IT infrastructure.
This comprehensive 2-in-1 course teaches you the key skills of Puppet 5.0 to effectively manage and automate your IT infrastructure. You'll learn through quick step-by-step instructions, clear explanations, and interesting real-world examples. It will give you all you need to know to use this essential IT power tool while applying these solutions to real-world scenarios.
This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.
The first course, Puppet 5 – The Complete Beginner’s Guide, gets you up-and-running with the very latest features of Puppet 5. From beginner to confident Puppet user with a series of clear, practical examples it will help you manage every aspect of your server setup. You will learn how to install packages and config files, create users, set up scheduled jobs, provision cloud instances, build containers, and more. Every example in this course deals with something real and practical that you're likely to need in your work, and you'll see the complete Puppet code that makes it happen, along with step-by-step instructions on what to type and what output you'll see.
The second course, Puppet 5 – From Beginner to Pro, starts off with explaining how to manage data with Hiera. You will then install ready-to-use modules from the Puppet Forge using the r10k tool. You will also learn some of the best ways to organize your Puppet code using roles and profiles. Next, you will learn to build complex configuration files with dynamic data using Puppet's EPP template mechanism. You will learn some new support features of Puppet 5 for deployment on Docker containers. Finally, you will learn how to use Puppet to provision cloud servers on AWS.
By the end of this Learning Path, you will have a greater understanding of puppet 5.0 and how to use all it's different parts to give you a powerful configuration management tool.
Meet Your Expert(s):
We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth: