Learning Puppet 4
by Jo Rhett
Copyright 2016 Jo Rhett. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Editor: Brian Anderson
- Production Editor: Kristen Brown
- Copyeditor: Rachel Monaghan
- Proofreader: Jasmine Kwityn
- Indexer: Judy McConville
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Rebecca Demarest
- April 2016: First Edition
Revision History for the First Edition
- 2016-03-22: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491907665 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Learning Puppet 4, the cover image of an European polecat, and related trade dress are trademarks of OReilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-491-90766-5
[LSI]
Foreword
I first met Jo Rhett online in the early 2000s. We were both active on the CFengine mailing lists, trying to administer production systems with methodologies that would come to be known as infrastructure as code. At the time, the concept of repeatable, convergent automation tools was fairly edgy, and the community that arose around the space also had its sharp edges. I seem to recall standing up at a LISA config management birds-of-a-feather session circa 2003, pointing at Mark Burgess, CFengines author, and shouting, You ruined my life! But you saved my life!
Luke Kanies was also a CFengine user at the time, and was consistently exhorting the community to introspect its shortcomings and evolve to the next level. His edginess led to some pretty epicthough mostly collegialdebates, borne out in papers such as Steve Traugotts Turing Equivalence in Systems Administration and Lukes ISConf: Theory, Practice, and Beyond.
Around 2005, Luke began writing a new tool in Ruby that was intended to address the problems with usability and flexibility he was running into with the rest of the ecosystem. Originally called Blink, the thing we know today as Puppet began its infancy as a CFengine module (actually a plugin, thus perpetuating an unfortunate relationship with English names that Puppet continues to this day), and Jo and I, along with the rest of the nascent configuration management community, followed its development with interest.
Fast-forward several years through a few iterations of Moores law, and witness the resultant explosion in processing power, distributed systems complexity, and their attendant burden on operations folk. Puppet had matured to become the dominant lingua franca of infrastructure; the tool wars of the mid-2000s had achieved dtente and our focus turned to culture, process, and the wider problems of tying infrastructure operations to business value: in a word, DevOps.
Id done tens of thousands of infrastructure buildouts on Puppet and eventually came to work at Puppet Labs, the company Luke formed around supporting and productizing Puppet. Jo was consulting at large companies around Silicon Valley, pushing Puppet to its limits and feeding bug fixes and feature requests into the community. As Puppets new product manager, this relationship was a little different (and frankly, sometimes far less comfortable, on my end!) than working as peers on the same project, but over the past several years its turned out to be hugely positive.
The thing I appreciate most about Jo, which I think shines through in the book youre about to read, is his sincere desire to help others. This is a core principle of the DevOps movement, usually stated as sharing or empathy, and Jos embodied it since the early days of CFengine. He consistently advocates for the tough right thing for the users, and while he will describe a range of possibilities with deep technical acumen and clear-eyed candor, in the end hell steer us, the readers, in the direction thats going to work out the best in the long term.
Puppets an amazing tool, but as the saying goes: With great power comes great responsibility. Jos depth of experience and empathy for other operations engineers make him the right person to show us how to use Puppets power responsibly. This book is the result, and Im deeply grateful to him for writing it.
Eric Sorenson
Technical Product Manager
Puppet Platform
Portland, Oregon, September 24, 2015
Preface
Twenty years ago, it was common for a single server to provide services for hundreds of users. A system administrator was often responsible for as few as 10 servers. Most people used only one computer.
In 2015, it is common for a normal, everyday person to own and utilize more than five highly advanced and capable computers. Think about the devices you use on a daily basis: every one of themthe phone on your desk, the cell phone on your hip, the tablet you read from, your laptop, and even the car you driveis thousands of times more powerful and capable than the large, room-sized servers used a few generations ago.
We live today in the midst of an information revolution. Systems capable of powerful computation that once required server rooms to contain are now able to be held in your hands. Explosive growth in the adoption and capabilities of modern technology has created a world full of computers. More and more devices every day contain powerful small computers that participate in the Internet of Things.
When I started my career, it was difficult to convince managers that every worker needed his or her own computer. Today, the workers are outnumbered by computers almost 20:1, and in certain industries by as much as 100:1. Advanced computing capability combined with cheap memory have revolutionized what businesses can accomplish with data. Even small teams of people utilize and depend upon thousands of computers. Every one of these devices needs to be managed. Its simply not possible to do it all by hand.
For this, we use Puppet.
Who This Book Is For
This book is primarily aimed at system administrators and operations or DevOps engineers. If you are responsible for development or production nodes, this book will provide you with immediately useful tools to make your job easier than ever before. If you run a high-uptime production environment, youre going to learn how Puppet can enforce standards throughout the implementation. Soon youll wonder how you ever got along without it.
No matter what you call yourself, if you feel that you spend too much time managing computers, then this book is for you. Youd like to get it done faster so you can focus on something else. Youd like to do it more consistently, so that you dont have to chase down one-off problems in your reports. Or youve got some new demands that youre looking for a way to solve. If any of these statements fit, Puppet will be one of the best tools in your toolbox.