Puppet modules can be flexible and cover multiple use cases. Add parameters to your module to allow some different options for how it's used.
- [Instructor] Our module is functional…but it's pretty limited.…It would be nice to have different options…like setting the install directory…or having an alternate jar URL.…Just like you can use parameters and resources,…classes can also take parameters.…It's fairly simple syntax to set up…but it can be a bit confusing at first.…Let's look at our class and add two parameters.…First of all, let's start by pulling out the strings…we're dealing with and using variables instead.…You'll recognize this syntax from the lesson about Facter.…
I'll create one variable called url,…and I'll set that equal to the string for the URL,…which I'll just copy and paste.…Then I can use that variable here instead.…Next I'll create a variable called install_dir,…install underscore dir,…and that should be set to opt/minecraft.…Now to use this variable,…it's going to be a bit more complicated.…We'll take that and paste it in…everywhere that opt/minecraft is used.…
For this one, for example,…we'll need to use the interpolation syntax…that we learned earlier,…
- What is Puppet?
- Setting up a Puppet master and control repo
- Using the built-in resource types
- Organizing code with roles and profiles
- Managing more nodes
- Triggering actions (orchestration)
- Gathering system info with facter
- Writing modules
- Using templates
Skill Level Beginner
DevOps Foundations: Infrastructure as Codewith Ernest Mueller2h 6m Intermediate
1. Puppet Overview
What is Puppet?4m 9s
2. Setting Up a Dev Environment
3. First Steps with Puppet
4. Managing More Nodes
Next steps3m 49s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.