Best practices and pitfalls
In earlier versions of Puppet, scope, dependencies, and containment were some of the most challenging issues, which led to significant problems for newer developers. One major solution that largely addressed these issues was the widespread adoption of the roles and profiles method, which will be covered in full detail in Chapter 8. Hiera data will be covered in Chapter 9.
The roles and profiles method involves grouping single-use component modules that perform one independent function well. For instance, a component module could install and configure Oracle. The module structure would contain a group of manifests with specific purposes, such as installing packages or managing services. This simplifies module organization and allows for the easier ordering of classes. For example, the install
class can be applied before the service
class.
Component modules should function independently of one another and have no direct dependencies across modules. The...