Book Image

Mastering Puppet

By : Thomas Uphill
Book Image

Mastering Puppet

By: Thomas Uphill

Overview of this book

Table of Contents (17 chapters)

Design pattern


The concept put forth by Craig Dunn in his blog is one that most Puppet masters arrive at independently. Modules should be nested in such a way that common components can be shared among nodes. The naming convention generally accepted is that roles contain one or more profiles. Profiles in turn contain one of more modules. Using the roles and profiles design pattern together with an ENC and hiera, you can have node-level logic that is very clean and elegant. The ENC and or hiera can be used to enforce standards on your nodes without interfering with the roles and profiles. We showed in Chapter 2, Organizing Your Nodes and Data, that with the virtual module, it is possible to have classes automatically applied by hiera to any system where the is_virtual fact is true. Using the same logic applied to facts such as osfamily, we can ensure that all the nodes for which osfamily is RedHat receive an appropriate module.

Putting all these elements together, we arrive at the following...