Best practices books are the result of years of professional experience. Unlike purely technical works, there often isnt always objectively correct best practices answer for every conceivable situation. By exposing this early release to your criticism, I hope to identify weaknesses in this book; sections that can be improved upon. If you find anything in this book confusing or incomplete, I encourage you to reach out for clarification. My goal is to produce the best work I possibly can. Your feedback is invaluable to this process, and very much appreciated.
My objective for this book is to share professional experience, help other IT professionals solve problems, and to improve the overall quality of code and infrastructure deployed in the real world.
About this pre-release
This work has not yet been professionally edited, and I hope you will forgive the grammar, syntax, and formatting errors that are present in this initial draft. Our goal is to document the core concepts of this book first, and then correct the flaws iteratively. What you currently see here is the product of passion and many sleepless nights fueled only by caffeine and determination.
While all feedback is sincerely appreciated, the most valuable feedback you can provide are your thoughts regarding the concepts and recommendations provided by this book. Do you find the discussion of programming principles useful? Do you disagree with any of the recommendations, and if so why? Is the material easy to understand, or confusing?
If you have any feedback, I request that you please reach out. Please feel free to email me at
Sincerely,
Chris Barbour,Author, Puppet Best Practices
Preface
This book is a work in progress new chapters will be added as they are written.We welcome feedback if you spot any errors or would like to suggest improvements, please email the author at .
In this book, we discuss on how to build and deploy highly maintainable Puppet code, with a focus on avoiding and eliminating technical debt.
Puppet is by far the most popular configuration management and automation platform available today, and is quickly being adopted by companies of all sizes, from single platform startups to established enterprises that may be using it to manage half a dozen different operating systems.
This book does not attempt to explain the basics of using Puppet; instead we will be looking at how to use Puppet most effectively. This will include discussions about the design decisions behind Puppet, an exploration of how to organize code and data, a look at many common features of Puppet, and discussions about common pitfalls and traps when deploying Puppet infrastructure.
Who Should Read This Book
This book is intended for readers who have some basic familiarity with Puppet and are interested in improving their understanding of Puppet and the surrounding ecosystem of tools. The concepts described in this book are appropirate for Puppet novices and experts alike, however readers who are new to Puppet should consider using this as a suppliment to Puppet Labs training or other introductory work that can provide a foundational understanding of Puppet.
This book is appropriate for all professionals working with Puppet, regardless of whether you are responsible for architecting Puppet infrastructure or responsible for writing a module or two to support a single application.
The information contained in this book will be invaluable to both green and brown field deployments of Puppet. If you are building a new environment, we will discuss how to lay a solid foundation that provides flexibility to grow and change. If you already have an exiting environment or are inheriting an environment, we will explore useful strategies to eliminate many pain points in your code base and improve upon what you have.
Why I Wrote This Book
This book draws heavily from experiences as a Puppet consultant. The folks Ive met while deploying Puppet have been very bright and talented individuals who were quick to learn the features of Puppet, and could often find very innovative ways of using those features to solve immediate problems, and to produce code that is impossible to understand.
Almost universlly, sites deploying Puppet have grown both quickly and organically. The consequences of design decisions made early in development often had reprocussions that were not obvious when they were originally made. As code became established and moved to production, it became harder and harder to correct those problems without risking the stability of the site that code manages.
None of these problems are specific to Puppet. As with any CFM solution, the amount of code being maintained will grow with the size of the site. It will often dwarf any other single codebase maintained by your operations team.
This book highlights design patterns, both good and bad, that can be used when building Puppet environments and discusses the impact of each decision. The coding patterns contained in this book will help you design code that can be extended, maintained, and supported not only by yourself, but by the people who may inherit your work down the road.
A Word on Puppet Today
Puppet Best Practices have changed significantly since Pupets early releases. In some ways, Puppet is much easier to work with and support. For example, parameterized modules and automatic data bindings have made it much simpler to re-use 3rd party modules. On the other hand, Puppet has added many new features and design patterns since then, and the demarcation points between various systems arent always clear.