Book Image

LEARNING PUPPET

Book Image

LEARNING PUPPET

Overview of this book

Table of Contents (17 chapters)
Learning Puppet
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

This book is a step-by-step guide to get started with Puppet development, and use Puppet modules as the building blocks to deploy production-ready application clusters in the virtual environment.

The journey begins with the installation of the development environment on the VirtualBox hypervisor and the installation of the Puppet Learning VM that will be used platforms to test and develop Puppet modules.

You will learn how to manage virtual machines and snapshots effectively and enhance the developer's experience with advanced VirtualBox features.

Once the development environment is up and running, this book will focus on Puppet module development in detail. You will be guided through the process of how to utilize the existing modules that are available in the public module repository, write your own modules, and use modules to deploy a real-world web application that includes features such as monitoring and load balancing. When an application cluster is deployed, the focus shifts to how to scale the environment and turn the static configuration into a dynamic one through stored configurations and PuppetDB. The latter part of the book will provide you with practical advice on Puppet troubleshooting, and how to manage your environment with a wealth of features provided by the Puppet Enterprise Console. Starting from the basics, this step-by-step guide will walk you through the process of becoming the master of your own Puppets.

What this book covers

Chapter 1, Puppet Development in Isolation, teaches you how to set up the local Puppet development environment quickly and start experimenting with Puppet on the command line in a matter of minutes.

Chapter 2, Managing Packages in Puppet, shows you how to restore the virtual machine snapshot and set up shared folders and host-only networking to enhance the developer's experience. You can also learn how to purge a software package using Puppet.

Chapter 3, My First Puppet Module, explains the concept of Puppet modules. You will learn how to install third-party Puppet modules from Puppet Forge and how to create and use your own modules.

Chapter 4, Monitoring Your Web Server, teaches you how to use Puppet to install the Nagios monitoring server and how to add a web server to monitor using Puppet.

Chapter 5, Load Balancing the Cluster, introduces you to parameterized classes and defined types and teaches you to use these to configure load balancing in the cluster.

Chapter 6, Scaling Up the Puppet Environment, introduces you to the Puppet Master, which enables you to centrally manage a large number of Puppet Agent nodes. You will learn how to sign Puppet Agent certificates and join agents to the Puppet environment.

Chapter 7, Making the Configuration Dynamic, teaches you how to use Puppet's Exported Resources to pass Puppet resources between nodes. This chapter also introduces you to the PuppetDB queries that are used to discover services in the cluster.

Chapter 8, Extending Puppet, teaches you how to extend Puppet beyond its built-in functionality. This chapter introduces you to custom facts and functions.

Chapter 9, The Puppet Enterprise Console, explores the Puppet Enterprise Console, which is a web-based management console that runs on the Puppet Master node. In this chapter, we will learn about Role-based Access Control and how to classify nodes using the External Node Classifier.

Chapter 10, Troubleshooting Puppet, teaches you how to identify the most common issues in Puppet and how to tackle them. This chapter provides you with basic troubleshooting skills.

What you need for this book

A computer that runs a Windows, Mac, or Linux operating system. The computer should have a minimum of 4 GB of memory and 10 GB of free hard drive space.

Who this book is for

This book is aimed at people who are new to configuration management and IT automation processes. You may have a background in software development, and you may have set yourself a goal of learning how to take full control of the software deployment process; or perhaps, you are more experienced in the system administration field, and are looking for better ways to manage system configuration changes at scale. Although previous experience in IT is helpful, it is not a requirement. This book will get you up to speed with Puppet development quickly and effortlessly.

Conventions

In this book, you will find a number of styles of text 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: "Experiment with the Puppet command-line commands puppet describe, puppet resource, and puppet apply."

A block of code is set as follows:

file {
  '/etc/sysconfig/network-scripts/ifcfg-eth1':
    content => 
'DEVICE="eth1"
BOOTPROTO="dhcp"
ONBOOT="yes"',
}

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

puppet describe --list | less

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Start the Oracle VM VirtualBox Manager and select Import Appliance from the File menu."

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 may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via 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 from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.

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.