Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Mastering Puppet Second Edition
Mastering Puppet Second Edition

Mastering Puppet Second Edition: Master Puppet for configuration management of your systems in an enterprise deployment , Second Edition

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Mastering Puppet Second Edition

Chapter 2. Organizing Your Nodes and Data

Now that we can deal with a large number of nodes in our installation, we need a way to organize the classes we apply to each node.

There are a few solutions to the problem of attaching classes to nodes. In this chapter, we will examine the following node organization methods:

  • An external node classifier (ENC)
  • LDAP backend
  • Hiera

Getting started

For the remainder of this chapter, we will assume that your Puppet infrastructure is configured with a single Puppet master running puppetserver. We will name this server puppet and give it the IP address 192.168.1.1. Any Puppet master configuration will be sufficient for this chapter; the configuration from the previous chapter was used in the examples of this chapter.

Organizing the nodes with an ENC

An ENC is a process that is run on the Puppet master or the host compiling the catalog, to determine which classes are applied to the node. The most common form of ENC is a script run through the exec node terminus. When using the exec node terminus, the script can be written in any language and it receives certname (certificate name) from the node, as a command-line argument. In most cases, this will be the Fully Qualified Domain Name (FQDN) of the node. We will assume that the certname setting has not been explicitly set and that the FQDN of our nodes is being used.

We will only use the hostname portion, as the FQDN can be unreliable in some instances. Across your enterprise, the naming convention of the host should not allow multiple machines to have the same hostname. The FQDN is determined by a fact; this fact is the union of the hostname fact and the domain fact. The domain fact on Linux is determined by running the hostname –f command. If...

Hiera

Hiera allows you to create a hierarchy of node information. Using Hiera, you can separate your variables and data from your modules. You start by defining what that hierarchy will be, by ordering lookups in the main configuration file, hiera.yaml. The hierarchy is based on facts. Any fact can be used, even your own custom facts may be used. The values of the facts are then used as values for the YAML files stored in a directory, usually called hieradata. More information on Hiera can be found on the Puppet Labs website at http://docs.puppetlabs.com/hiera/latest.

Tip

Facts are case sensitive in Hiera and templates. This could be important when writing your hiera.yaml script.

Configuring Hiera

Hiera only needs to be installed on your Puppet master nodes. Using the Puppet Labs repo, Hiera is installed by the puppet-agent package. Our installation pulled down puppet-agent-1.2.2-1.el7.x86_64, which installs Hiera version 3.0.1, as shown here:

[thomas@stand ~]$ hiera --version
3.0.1

Previous...

Summary

The classes that are applied to nodes should be as automatic as possible. Using a hostname convention and an ENC script, it is possible to have classes applied to nodes without any node-level configuration.

Using LDAP as a backend for class information may be a viable alternative at your enterprise. The LDAP schema included with Puppet can be successfully applied to an OpenLDAP instance or integrated into your existing LDAP infrastructure.

Hiera is a powerful tool to separate data from your module definitions. By utilizing a hierarchy of facts, it is possible to dynamically apply classes to nodes based on their facts.

The important concept in the enterprise is to minimize the customization required in the modules and push that customization up into the node declaration, to separate the code required to deploy your nodes from the specific data, through either LDAP, a custom ENC, or clever use of Hiera. If starting from scratch, Hiera is the most powerful and flexible solution to this...

Left arrow icon Right arrow icon

Key benefits

  • 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

Description

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.

Who is this book 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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 25, 2016
Length: 276 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785882593
Vendor :
Puppet
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 25, 2016
Length: 276 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785882593
Vendor :
Puppet
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
Puppet 4 Essentials, Second Edition
€36.99
Extending Puppet
€32.99
Mastering Puppet Second Edition
€41.99
Total 111.97 Stars icon
Banner background image

Table of Contents

11 Chapters
1. Dealing with Load/Scale Chevron down icon Chevron up icon
2. Organizing Your Nodes and Data Chevron down icon Chevron up icon
3. Git and Environments Chevron down icon Chevron up icon
4. Public Modules Chevron down icon Chevron up icon
5. Custom Facts and Modules Chevron down icon Chevron up icon
6. Custom Types Chevron down icon Chevron up icon
7. Reporting and Orchestration Chevron down icon Chevron up icon
8. Exported Resources Chevron down icon Chevron up icon
9. Roles and Profiles Chevron down icon Chevron up icon
10. Troubleshooting Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(1 Ratings)
5 star 0%
4 star 100%
3 star 0%
2 star 0%
1 star 0%
Josh Miller Apr 16, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Mastering Puppet - Second Edition was a book that I looked forward to reading. After finishing this book, it is clear that Thomas Uphill is not only experienced but a highly skilled professional in this field . Reading this book reminded me of 15 years ago when I began my IT career as a budding system administrator and I would read through the shell history of more experienced professionals to gain valuable insight and powerful command knowledge.I enjoyed the flow of topics that began with chapter 1 on load and scale through chapter 10 on debugging and troubleshooting. While I was, at first, uncertain as to why load and scale were the first topic, it later made sense as making those decisions early on would have a huge impact on deployment considerations later on. This is, after all, "Mastering Puppet", not an introductory book. The book continues through node organization, (roles and profiles come later on), source control, modules, and custom facts, modules, and types, with reporting thrown in on chapter 7.There was some confusion, on my part, in chapter 5 when Thomas presented the reader with an error and failed to explain it before starting the next section which then covered how to resolve the error. My expectation was that it would be resolved before moving on but it worked out in the end (duplicate package declaration).I appreciated the inclusion of SELinux, filesystem ACLs, and security as integral topics as the role of the security professional should, in my opinion, be upon all of us professionals and not an isolated profession.While I can easily recommend this book, I must admit some reservations. I feel that for a book that might cost $30-50 to purchase, the quality of the formatting and review should have been better, especially for a second edition book. There are blank pages between some chapters and not others, there are capitalization errors, missing spaces, screen shots on some output, text output on others, in a somewhat inconsistent manner. There are also some screen shots in the LVM section that completely omit the relevant portion of the screen shot (/dev/sdb). (I am reviewing the ebook formatted version.)Thomas, thank you for the good read. I look forward to seeing the formatting issues addressed in a future version.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.