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 - Puppet Tutorial
From the course: Puppet Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Resources5m 41s
-
(Locked)
Classes5m 23s
-
(Locked)
The node graph4m 36s
-
(Locked)
Generate a node graph2m 50s
-
(Locked)
Defined resource types1m 51s
-
(Locked)
Variables and conditionals5m 29s
-
(Locked)
Iteration2m 17s
-
(Locked)
Facts and functions4m 18s
-
(Locked)
More resources2m 54s
-
(Locked)
✓ Challenge: Simplify a manifest21s
-
(Locked)
✓ Solution: Simplify a manifest1m 13s
-
-
-
-
-
-
-