Learn how to write your own module by following the simple example of managing a Minecraft server using Puppet.
- [Instructor] Now that we have the basic outline,…we're ready to start writing a module.…First we'll create some directories and files…in the control_repo.…These should go under site,…which is where we set up our custom modules.…First we'll create a new file.…That's in site/minecraft/manifests,…and it will be called init.pp.…Remember, manifests/init.pp should always contain a class…with the same name as the module itself.…So first we'll create a class and a file resource…for the opt/minecraft directory, class minecraft,…and then file ('/opt/minecraft'),…ensure => directory.…
Now we wanted a way of downloading the Minecraft server jar.…Thankfully, that's a built-in feature…of the file resource type.…So we can just set the source to the URL we used earlier,…file ('/opt/minecraft/minecraft_server.jar',…ensure => file, source =>,…and I'll paste in the URL from before.…This will also take care of renaming the file…so that we don't have to keep track of the version number.…
Next, Java needs to be installed,…which we can do with a package resource,…
- 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.