The concept put forth by Craig Dunn in his blog is the one at which most Puppet masters arrive independently. Modules should be nested in such a way that common components can be shared among nodes. The naming convention that is generally accepted is that roles contain one or more profiles. Profiles in turn contain one or more modules. You can have a node-level logic that is very clean and elegant using the roles and profile design patterns, together with an ENC and Hiera,. The ENC and/or Hiera can also be used to enforce standards on your nodes without interfering with the roles and profiles. As we discussed in Chapter 2, Organizing Your Nodes and Data, with the virtual module it is possible to have Hiera apply classes automatically to any system where the is_virtual
fact is true. Applying the same logic 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...