Book Image

Mastering Puppet - Second Edition

By : Thomas Uphill
Book Image

Mastering Puppet - Second Edition

By: Thomas Uphill

Overview of this book

Puppet is a configuration management system and a language. It was written for and by system administrators to manage large numbers of systems efficiently and prevent configuration drifts. Mastering Puppet deals with the issues faced when scaling out Puppet to handle large numbers of nodes. It will show you how to fit Puppet into your enterprise and allow many developers to work on your Puppet code simultaneously. In addition, you will learn to write custom facts and roll your own modules to solve problems. Next, popular options for performing reporting and orchestration tasks will be introduced in this book. Moving over to troubleshooting techniques, which will be very useful. The concepts presented are useful to any size organization. By the end of the book, you will know how to deal with problems of scale and exceptions in your code, automate workflows, and support multiple developers working simultaneously.
Table of Contents (17 chapters)

Preface

The complexity of your installation will increase with the number of nodes in your organization. Working on a small deployment with a few developers is much simpler than working on a large installation with many developers.

Mastering Puppet Second Edition deals with the issues faced by larger deployments, such as scaling and versioning. This book will show you how to fit Puppet into your organization and keep everyone working. The concepts presented can be adopted to suit any size organization.

What this book covers

Chapter 1, Dealing with Load/Scale, will show you how to scale your Puppet infrastructure as your node count increases.

Chapter 2, Organizing Your Nodes and Data, is where we show different methods of applying modules to nodes. We look at Hiera and external node classifiers (ENCs).

Chapter 3, Git and Environments, introduces Git and how to use Git as an integral component of your Puppet infrastructure.

Chapter 4, Public Modules, shows how to use Puppet Forge as a source of modules and how to use several popular modules in your organization.

Chapter 5, Custom Facts and Modules, is where we extend Puppet with custom facts and start writing our own modules.

Chapter 6, Custom Types, is where we introduce defined types and show how to extend the Puppet language with our own custom types and providers.

Chapter 7, Reporting and Orchestration, is where we configure reporting to help track down errors in our Puppet deployments.

Chapter 8, Exported Resources, explains how useful it is to have resources on one node that can be applied to other nodes in your organization.

Chapter 9, Roles and Profiles, shows a popular design pattern in Puppet node deployments. Here we present the concept and show example usage.

Chapter 10, Troubleshooting, is where we show some common errors found in Puppet deployments, as well as possible solutions.

What you need for this book

All the examples in this book were written and tested using an Enterprise Linux 7 derived installation, such as CentOS 7, Scientific Linux 7, or Springdale Linux 7. Additional repositories used were EPEL (Extra Packages for Enterprise Linux), the Software Collections (SCL) repository, the Foreman repository, and the Puppet Labs repository. The version of Puppet used was the latest 4.2 series at the time of writing.

Who this book is for

This book is for those who have intermediate knowledge of Puppet and are looking to deploy it in their environment. Some idea of how to write simple modules for configuration management with Puppet is a prerequisite for this book.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Now sign the certificate using the puppet cert sign command."

A block of code is set as follows:

yumrepo { 'example.com-puppet':
  baseurl  => 'http://puppet.example.com/noarch',
  descr    => 'example.com Puppet Code Repository',
  enabled  => '1',
  gpgcheck => '0',
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

node_terminus = ldap
ldapserver = ldap.example.com
ldapbase = ou=hosts,dc=example,dc=com

Any command-line input or output is written as follows:

# puppetserver gem install jruby-ldap

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "You can also navigate to the Monitor | Reports section to see the latest reports."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.