Mastering Puppet - Second Edition - Thomas Uphill - E-Book

Mastering Puppet - Second Edition E-Book

Thomas Uphill

0,0
43,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Master Puppet for configuration management of your systems in an enterprise deployment

About This Book

  • This book is an advanced guide to using and deploying Puppet 4 in your organization with a special focus on issues faced in larger enterprise deployments
  • From an experienced author, learn to deal with scaling, performance, and multiple developers with the help of real-world examples
  • This is the most up-to-date guide on Puppet, and covers the advanced concepts of Puppet 4

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 how to write simple modules for configuration management with Puppet is a prerequisite for this book.

What You Will Learn

  • Scale out your Puppet infrastructure using proxying techniques
  • Automate your code promotion workflow using Git and r10k
  • Solve real-world problems using public modules from the Puppet Forge
  • Use Hiera to separate the data of your configuration from the code of your configuration
  • Write your own custom facts in Ruby
  • Extend Puppet with your own custom facts, modules, and types
  • Use exported resources to orchestrate change between machines
  • Debug a puppetserver using Java techniques

In Detail

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.

Style and approach

This book is a step-wise guide packed with examples to help you configure complex systems in Puppet.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 302

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Mastering Puppet Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Dealing with Load/Scale
Divide and conquer
Certificate signing
Reporting
Storeconfigs
Catalog compilation
puppetserver
Building a Puppet master
Certificates
systemd
Creating a load balancer
Apache proxy
TLS headers
SELinux
Configuring masters
Keeping the code consistent
rsync
NFS
Clustered filesystem
Git
One more split
One last split or maybe a few more
Conquer by dividing
Creating an rpm
Using Puppet resource to configure cron
Creating the yum repository
Summary
2. Organizing Your Nodes and Data
Getting started
Organizing the nodes with an ENC
A simple example
Hostname strategy
Modified ENC using hostname strategy
LDAP backend
OpenLDAP configuration
Hiera
Configuring Hiera
Using hiera_include
Summary
3. Git and Environments
Environments
Environments and Hiera
Multiple hierarchies
Single hierarchy for all environments
Directory environments
Git
Why Git?
A simple Git workflow
Git hooks
Using post-receive to set up environments
Puppet-sync
Using Git hooks to play nice with other developers
Not playing nice with others via Git hooks
Git for everyone
Summary
4. Public Modules
Getting modules
Using GitHub for public modules
Updating the local repository
Modules from the Forge
Using Librarian
Using r10k
Using Puppet-supported modules
concat
inifile
firewall
Logical volume manager
Standard library
Summary
5. Custom Facts and Modules
Module manifest files
Module files and templates
Naming a module
Creating modules with a Puppet module
Comments in modules
Multiple definitions
Custom facts
Creating custom facts
Creating a custom fact for use in Hiera
CFacter
Summary
6. Custom Types
Parameterized classes
Data types
Defined types
Types and providers
Creating a new type
Summary
7. Reporting and Orchestration
Turning on reporting
Store
Logback
Internet relay chat
Foreman
Installing Foreman
Attaching Foreman to Puppet
Using Foreman
Puppet GUIs
mcollective
Installing ActiveMQ
Configuring nodes to use ActiveMQ
Connecting a client to ActiveMQ
Using mcollective
Ansible
Summary
8. Exported Resources
Configuring PuppetDB – using the Forge module
Manually installing PuppetDB
Installing Puppet and PuppetDB
Installing and configuring PostgreSQL
Configuring puppetdb to use PostgreSQL
Configuring Puppet to use PuppetDB
Exported resource concepts
Declaring exported resources
Collecting exported resources
Simple example – a host entry
Resource tags
Exported SSH keys
sshkey collection for laptops
Putting it all together
Summary
9. Roles and Profiles
Design pattern
Creating an example CDN role
Creating a sub-CDN role
Dealing with exceptions
Summary
10. Troubleshooting
Connectivity issues
Catalog failures
Full trace on a catalog compilation
The classes.txt file
Debugging
Personal and bugfix branches
Echo statements
Scope
Profiling and summarizing
Summary
Index

Mastering Puppet Second Edition

Mastering Puppet Second Edition

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: July 2014

Second edition: February 2016

Production reference: 1220216

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78588-810-6

www.packtpub.com

Credits

Author

Thomas Uphill

Reviewer

Bas Grolleman

Commissioning Editor

Priya Singh

Acquisition Editor

Nadeem Bagban

Content Development Editor

Mehvash Fatima

Technical Editor

Taabish Khan

Copy Editors

Ting Baker

Sneha Singh

Project Coordinator

Kinjal Bari

Proofreader

Safis Editing

Indexer

Tejal Daruwale Soni

Production Coordinator

Aparna Bhagat

Cover Work

Aparna Bhagat

About the Author

Thomas Uphill is a long-time user of Puppet. He has presented Puppet tutorials at LOPSA-East, Cascada, and PuppetConf. He has also been a system administrator for over 20 years, working primarily with RedHat systems; he is currently a RedHat Certified Architect (RHCA). When not running the Puppet User Group of Seattle (PUGS), he volunteers for the LOPSA board and his local LOPSA chapter, SASAG. He blogs at http://ramblings.narrabilis.com.

About the Reviewer

Bas Grolleman works as a self-taught freelance Puppet professional in the Netherlands, he has his name in the code of many large-scale deployments. He learned the pain of scaling Puppet the hard way, that is, trial and error and spending hours going through a maze of dependencies. Now, he mostly tells people to take the time to do it right.

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

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.

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 <[email protected]>, 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:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enter the name of the book in the Search box.Select the book for which you're looking to download the code files.Choose from the drop-down menu where you purchased this book from.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 WindowsZipeg / iZip / UnRarX for Mac7-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 <[email protected]> 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 <[email protected]>, and we will do our best to address the problem.