Skip to Content
Learning Puppet 4
book

Learning Puppet 4

by Jo Rhett
April 2016
Intermediate to advanced
594 pages
12h 53m
English
O'Reilly Media, Inc.
Content preview from Learning Puppet 4

Chapter 7. Expressing Relationships

This chapter focuses on metaparameters that create and manage relationships between resources.

After parsing all of the Puppet manifests, Puppet builds a dependency graph used to structure the application of changes. Relationships between resources control the order in which resources are evaluated.

Resource relationships and ordering are perhaps the most confusing topics for newcomers to Puppet. Most people are familiar with linear processing, controlled by the order expressed within the file. Puppet provides metaparameters to define dependencies to be handled within and between manifests. This is significantly more powerful than rigid, linear ordering for the following reasons:

  • Linear ordering is easy to write once, but difficult to maintain over time.
  • Linear ordering prevents code from easily extending common or shared code.
  • Targeted relationships allow for multiple dependencies beyond strict ordering.
  • Many-to-one relationships are considerably more powerful, albeit harder to learn.
  • Loose ordering allows isolation of dependences for failed resources.

You will appreciate the power and flexibility of Puppet’s resource ordering when you build a module that extends (or “wraps”) a community-provided module. For now, simply keep in mind that Puppet will process the resources by evaluating the dependency graph created from the metaparameters introduced in this chapter.

Managing Dependencies

There are situations where avoiding implicit dependencies ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro Puppet, Second Edition

Pro Puppet, Second Edition

Spencer Krum, William Van Hevelingen, Ben Kero, James Turnbull, Jeffery McCune
Mastering Puppet 5

Mastering Puppet 5

Ryan Russell-Yates, Jason Southgate

Publisher Resources

ISBN: 9781491907993Purchase bookErrata Page