From the course: Puppet Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Defined resource types

Defined resource types - Puppet Tutorial

From the course: Puppet Essential Training

Start my 1-month free trial

Defined resource types

- [Instructor] So far, we've looked at building puppet code from built in resources and organizing them into classes. What if you wanna build your own resource type? Creating custom resource types is as easy as creating classes. We'll look at the basics of creating a custom type and how to use your own defined resource type. Often, you'll create a custom defined resource type, but you have a class or a section of code that you wanna repeat multiple times. You could use an iterator for this, which we'll cover later. But defined types offer some abstraction and can make your code much more readable. This is an example of a class that creates an admin user and it swallows their public access age key so that they can log in securely. But because it's a class, we can only use it once. The only change you need to make in this example to convert it to a defined type is to change the word class to define. That seems pretty simple, but there's one important caveat. Remember that each resource…

Contents