Puppet:Mastering Infrastructure Automation
上QQ阅读APP看书,第一时间看更新

Chapter 6. Leveraging the Full Toolset of the Language

After our in-depth discussions on both, the manifest structure elements (class and define) and encompassing structure (modules), you are in a great position to write manifests for all of your agents. Make sure that you get Forge modules that will do your work for you. Then, go ahead and add site-specific modules that supply composite classes for the node blocks to be used, or rather, included.

These concepts are quite a bit to take in. It's now time to decelerate a bit, lean back, and tackle simpler code structures and ideas. You are about to learn some techniques that you are not going to need every day. They can make difficult scenarios much easier, though. So, it might be a good idea to come back to this chapter again after you have spent some time in the field. You might find that some of your designs can be simplified with these tools.

Specifically, these are the techniques that will be presented:

  • Templating dynamic configuration files
  • Creating virtual resources
  • Exporting resources to other agents
  • Overriding resource parameters
  • Saving redundancy using resource defaults
  • Avoiding antipatterns