Using Puppet code
Define the desired state of your infrastructure using Puppet code.
Puppet code is stored in modules. If you are new to Puppet or want to save time, use the pre-built and tested modules on the Puppet Forge — a repository of thousands of modules made by Puppet developers and the Puppet community.
Modules manage specific tasks in your infrastructure, such as installing and configuring a piece of software. Modules contain both code and data. The data is what allows you to customize your configuration. Using a tool called Hiera, you can separate the data from the code and place it in a centralized location. This allows you to specify guardrails and define known parameters and variations, so that your code is fully testable and you can validate all the edge cases of your parameters.
If you are an advanced user and want to write your own Puppet code, refer to the Puppet language and modules documentation.
-
Classifying nodes
You can classify nodes using an external node classifier (ENC), which is a script or application that tells Puppet which classes a node must have. It can replace or work in concert with the node definitions in the main site manifest (site.pp
). -
Managing environment content with a Puppetfile
A Puppetfile specifies detailed information about each environment's Puppet code and data. -
Using content from Puppet Forge
Puppet Forge is a collection of modules and how-to guides developed by Puppet and its community. -
Designing system configs (roles and profiles)
Your typical goal with Puppet is to build complete system configurations, which manage all of the software, services, and configuration that you care about on a given system. The roles and profiles method can help keep complexity under control and make your code more reusable, reconfigurable, and refactorable. -
Separating data (Hiera)
Hiera is a built-in key-value configuration data lookup system, used for separating data from Puppet code. -
Use case examples
Try out some common configuration tasks to see how you can use Puppet to manage your IT infrastructure.