Puppet reference manual


















This introduction is intended for new users to Puppet. We go over what Puppet is, what problems it solves, and the concepts and practices that are key to being successful with Puppet. Puppet is a tool that helps you manage and automate the configuration of servers.

When you use Puppet , you define the desired state of the systems in your infrastructure that you want to manage. You do this by writing infrastructure code in Puppet 's Domain-Specific Language DSL — Puppet Code — which you can use with a wide array of devices and operating systems.

Puppet code is declarative , which means that you describe the desired state of your systems, not the steps needed to get there. Puppet then automates the process of getting these systems into that state and keeping them there. Puppet does this through Puppet primary server and a Puppet agent.

The Puppet primary server is the server that stores the code that defines your desired state. The Puppet agent translates your code into commands and then executes it on the systems you specify, in what is called a Puppet run.

The diagram below shows how the server-agent architecture of a Puppet run works. The primary server and the agent are part of the Puppet platform, which is described in The Puppet platform — along with facts, catalogs and reports. There are many benefits to implementing a declarative configuration tool like Puppet into your environment — most notably consistency and automation. Check out the following video of how a DevOps engineer uses Puppet :.

Using Puppet is not just about the tool, but also about a different culture and a way of working. The following concepts and practices are key to using and being successful with Puppet. Puppet is built on the concept of infrastructure-as-code , which is the practice of treating infrastructure as if it were code. This concept is the foundation of DevOps — the practice of combining software development and operations.

Treating infrastructure as code means that system administrators adopt practices that are traditionally associated with software developers, such as version control, peer review, automated testing, and continuous delivery. These practices that test code are effectively testing your infrastructure. When you get further along in your automation journey, you can choose to write your own unit and acceptance tests — these validate that your code, your infrastructure changes, do as you expect.

To learn more about infrastructure-as-code and how it applies to Puppet , see our blog What is infrastructure as code? A key feature of Puppet is idempotency — the ability to repeatedly apply code to guarantee a desired state on a system, with the assurance that you will get the same result every time. Idempotency is what allows Puppet to run continuously. It ensures that the state of the infrastructure always matches the desired state. If a system state changes from what you describe, Puppet will bring it back to where it is meant to be.

It also means that if you make a change to your desired state, your entire infrastructure automatically updates to match. To learn more about idempotency, see our Understanding idempotency documentation. When adopting a tool like Puppet , you will be more successful with an agile methodology in mind — working in incremental units of work and reusing code. The following pages are good starting points for getting familiar with Puppet : Language An outline of how the Puppet language works.

Resources , variables , conditional statements , and relationships and ordering are the fundamental pieces of the Puppet language. Classes and defined types are how you organize Puppet code into useful chunks. You can assign classes to nodes in the PE console. Facts and built-in variables explains the special variables you can use in your Puppet manifests. Modules Most Puppet code goes in modules.

We explain how modules work here. There are also guides to installing modules and publishing modules on the Forge. Use the code management features included in PE to control your modules instead of installing by hand. See Managing and deploying Puppet code in the PE manual for more details.

Built-in resource types and functions The resource type reference has info about all of the built-in Puppet resource types. Start with the overview and use the navigation sidebar to get around. Note: Hiera 5 is a backwards-compatible evolution of Hiera, which is built into Puppet.

To provide some backwards-compatible features, it uses the classic Hiera 3 codebase. Current version. Puppet Puppet docs Puppet is the core of our configuration management platform. Note: The Puppet manual has information about installing the open source release of Puppet.

As a PE user, you should ignore those pages. The following pages are good starting points for getting familiar with Puppet : Language An outline of how the Puppet language works. Resources , variables , conditional statements , and relationships and ordering are the fundamental pieces of the Puppet language.

Classes and defined types are how you organize Puppet code into useful chunks. This feature is supported in Puppet by using facter. In Puppet, facter is a standalone tool that holds the environment level variable. In can be considered similar to env variable of Bash or Linux. Sometimes there can be an overlap between the information stored in facts and environment variable of the machine. Each resource has its own facts and in Puppet the user has the leverage to build their own custom facts.

Facter command can be used to list all the different environment variables and its associated values. These collection of facts comes with facter out-of-the-box and are referred to as core facts.



0コメント

  • 1000 / 1000