Puppet Best Practices: Design Patterns for Maintainable Code
Puppet Best Practices: Design Patterns for Maintainable Code
These are the high-level descriptions of a machine's function (e.g., role::app_server ). A node should ideally have only one role . 2. Separation of Code and Data (Hiera) Puppet Best Practices: Design Patterns for Main...
3. Coding Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Swiss Bay
These are the building blocks (e.g., puppetlabs-apache ). They handle the "how" but shouldn't contain business-specific data. Puppet Best Practices: Design Patterns for Maintainable Code
These wrap component modules to define a specific technology stack (e.g., profile::webserver ). They handle local logic and Hiera lookups.
Keep your logic in your profiles and your specific values in your Hiera YAML files. 3. Maintainable Module Design Separation of Code and Data (Hiera) 3
Never hardcode configuration values like IP addresses or package versions directly into your manifests. Use Hiera to keep your code "clean" and your data flexible.