Chapter 2. Writing Puppet Manifests

Puppet code is organized in manifests. In this chapter, we will cover how to write code in a way that reduces problems. We'll look at how one can configure editors to automatically correct code and keep it in style. Then, we'll look at how we can use tools to check the code for errors. Finally, we'll see how to use Git and Vagrant to automate the testing of our code.

Writing code

The Puppet style guide (for more information, visit was developed to define a common way of writing code that reduces errors. The style guide makes several suggestions to make your code more readable and consistent.

A common syntax error is to forget a comma between the attributes of ...

Get Troubleshooting Puppet now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.