O'Reilly logo

Learning Puppet 4 by Jo Rhett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Wrap-Up of Puppet Basics

In this part, you’ve created a safe, risk-free learning environment you can utilize to write and test Puppet manifests. You’ve learned the following things about Puppet:

  • Puppet policies are written in manifests.
  • Manifests contain one or more resource declarations.
  • Resources create, alter, or remove their types: user, group, file, and so on.
  • Facter provides data about the node useful for local customization.

You have learned each part of the Puppet configuration language and how to utilize it to create manifests. You’ve used Puppet to apply the manifest on your test system. puppet apply does the following:

  • Parses a manifest file and reports any errors.
  • Utilizes facts about the system as variables for customization.
  • Executes immediately on the local system.
  • Provides verbose output informing you of what it has done.
Tip
While many people utilize puppet apply only for testing manifest changes, it can be used at broad scale if a method of synchronizing manifests to each node is available. We’ll discuss the pros and cons of this approach in Part IV.

Best Practices for Writing Manifests

Before moving on to the next chapter, I’d like to remind you of best practices for writing Puppet manifests:

  • Quote all unquoted string values.
  • ensure should be the first attribute in a resource block.
  • Align the arrows for attributes within a resource block.
  • Enable the strict_variables configuration setting to catch errors while testing.
  • Group resources by their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required