Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Puppet 5 Essentials Third Edition
Puppet 5 Essentials Third Edition

Puppet 5 Essentials Third Edition: A fast-paced guide to automating your infrastructure , Third Edition

Arrow left icon
Profile Icon Martin Alfke Profile Icon Felix Frank
Arrow right icon
$27.98 $39.99
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1 (1 Ratings)
eBook Sep 2017 262 pages 3rd Edition
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Martin Alfke Profile Icon Felix Frank
Arrow right icon
$27.98 $39.99
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1 (1 Ratings)
eBook Sep 2017 262 pages 3rd Edition
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.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
Table of content icon View table of contents Preview book icon Preview Book

Puppet 5 Essentials Third Edition

Puppet Server and Agents

So far, you have dealt with some concise Puppet manifests that were built to model some very specific goals. By means of the puppet apply command, you can use such snippets on any machine in your infrastructure. This is not the most common way of using Puppet, though, and this chapter will introduce you to the popular server/agent structure. It's worth noting, however, that applying standalone manifests that are independent of your overall Puppet design can always be useful.

Under the server/agent paradigm, you will typically install the Puppet agent software on all nodes under your care and make them call the server, which is yet another Puppet installation. The server will compile the appropriate manifests and effectively remotely control the agents. Both the agent and the server authenticate themselves using trusted SSL certificates.

This chapter...

The Puppet server

Many Puppet-based workflows are centered on the server, which is the central source of configuration data and authority. The server hands instructions to all the computer systems in the infrastructure (where agents are installed). It serves multiple purposes in the distributed system of Puppet components.

The server will perform the following tasks:

  • Storing manifests and compiling catalogs
  • Serving as the SSL certification authority
  • Processing reports from the agent machines
  • Gathering and storing information about the agents

As such, the security of your server machine is paramount. The requirements for hardening are comparable to those of a Kerberos key distribution center.

During its first initialization, the Puppet server generates the CA certificate. This self-signed certificate will be distributed among and trusted by all the components of your infrastructure...

Setting up the Puppet agent

As was explained earlier, the master mainly serves instructions to agents in the form of catalogs that are compiled from the manifest. You have also prepared a node block for your first agent in the master manifest.

Installing the agent software is easy; you did this at the start of Chapter 1, Writing Your First Manifests. The plain Puppet package that allows you to apply a local manifest contains all the required parts in order to operate a proper agent.

If you are using Puppet Labs packages, use the instructions from earlier in this chapter. On agent machines, you need not install the puppetserver package. Just get puppet-agent instead.

After a successful package installation, one needs to specify where puppet agent can find the puppet server:

root@puppetmaster # puppet config set –-section agent server pup-petmaster.example.net 

Afterwards...

Performance optimizations

Operating a Puppet master gives you numerous benefits over just using puppet apply on all your machines. This comes at a cost, of course. The master and agents form a server/client relation, and, as with most such constructs, the server can become the bottleneck.

The good news is that the Puppet agent is a fat client. The major share of the work inspecting file contents, interfacing with the package-management subsystem, services subsystem, and much more is done by the agent. The master only has to compile manifests and build catalogs from them. This becomes increasingly complex as you hand over more control to Puppet.

There is one more task your master is responsible for. Many of your manifests will contain file resources that rely on prepared content:

file { '/usr/local/etc/my_app.ini':
ensure => file,
owner => 'root',
...

Completing the stack with PuppetDB

PuppetDB is a specialized database REST API designed to interact with the Puppet master. It mainly comprises a PostgreSQL backend with an API wrapper. The latter was written in Clojure and runs in yet another JVM.

PuppetDB aids the master's secondary task of storing reports and other agent data. It is also necessary for some specific manifest compiler functionality. This is covered in Chapter 6, The Puppet Beginners Advanced Parts.

The best way to set up and configure PuppetDB is actually Puppet itself. Since the necessary tools have not yet been introduced, we will postpone this step until Chapter 6, The Puppet Beginners Advanced Parts. This is not a problem, because PuppetDB is not essential for basic master operation.

Nevertheless, after finishing this chapter, you should include PuppetDB into any new master setup because it allows for...

The Puppet CA

Among the most frustrating issues, especially for new users, are problems with the agent's SSL handshake. Such errors are especially troublesome because Puppet cannot always offer very helpful analysis in its logs - the problems occur in the SSL library functions, and the application cannot examine the circumstances.

The online documentation at Puppet Labs has a troubleshooting section that also has some advice concerning SSL-related issues at https://docs.puppetlabs.com/guides/troubleshooting.html.

Consider the following output for the --test command:

root@agent# puppet agent --test
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect returned=1 errno=0 state=unknown state: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: puppet.example.net]

The agent opines that the CRL it receives from the master...

Summary

You can now set up your own Puppet master, using the sophisticated puppetserver solution. You have successfully signed the certificate for a Puppet agent and can revoke certificates, if required. Using the node blocks in the master manifest, you can describe individual manifests for each distinct agent. Finally, you learned about some things that can go wrong with the SSL-based authentication.

In Chapter 3, A Peek into the Ruby Part of Puppet - Facts, Types, and Providers, we will take a look at the inner workings of Puppet in order to give you an understanding of how the Puppet agent adapts to its environment. You will also learn how the agent provides feedback to the master, allowing you to create flexible manifests that fit different needs.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Breeze through Puppet's key features and performance improvements to bring real advantages to your IT infrastructure
  • Discover Puppet best practices to help you avoid common mistakes and pitfalls
  • Examples to help you get to grips with Puppet and succeed with everyday IT automation

Description

Puppet is a configuration management tool that allows you to automate all your IT configurations, giving you control over what you do to each Puppet Agent in a network, and when and how you do it. In this age of digital delivery and ubiquitous Internet presence, it's becoming increasingly important to implement scaleable and portable solutions, not only in terms of software, but also the system that runs it. This book gets you started quickly with Puppet and its tools in the right way. It highlights improvements in Puppet and provides solutions for upgrading. It starts with a quick introduction to Puppet in order to quickly get your IT automation platform in place. Then you learn about the Puppet Agent and its installation and configuration along with Puppet Server and its scaling options. The book adopts an innovative structure and approach, and Puppet is explained with flexible use cases that empower you to manage complex infrastructures easily. Finally, the book will take readers through Puppet and its companion tools such as Facter, Hiera, and R10k and how to make use of tool chains.

Who is this book for?

This book targets experienced IT professionals and new Puppet uses, who will learn all they need to know to go from installation to advanced automation. Get a rapid introduction to the essential topics and learn how to build best practices for advanced automation with Puppet.

What you will learn

  • Understand declarative configuration management
  • Make use of GIT-based deployment workflows
  • Extend Factor with secure elements
  • Create modular and reusable Puppet code
  • Extend your code base with publicly available Puppet modules
  • Separate logic from data by using Hiera
  • Understand and develop Puppet Roles and Profiles

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 13, 2017
Length: 262 pages
Edition : 3rd
Language : English
ISBN-13 : 9781787285361
Vendor :
Puppet
Concepts :
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

Product Details

Publication date : Sep 13, 2017
Length: 262 pages
Edition : 3rd
Language : English
ISBN-13 : 9781787285361
Vendor :
Puppet
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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
$279.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 $ 177.97
Puppet: Mastering Infrastructure Automation
$84.99
Puppet 5 Beginner???s Guide
$43.99
Puppet 5 Essentials Third Edition
$48.99
Total $ 177.97 Stars icon

Table of Contents

9 Chapters
Writing Your First Manifests Chevron down icon Chevron up icon
Puppet Server and Agents Chevron down icon Chevron up icon
A Peek into the Ruby Part of Puppet - Facts, Types, and Providers Chevron down icon Chevron up icon
Combining Resources in Classes and Defined Types Chevron down icon Chevron up icon
Combining Classes, Configuration Files, and Extensions into Modules Chevron down icon Chevron up icon
The Puppet Beginners Advanced Parts Chevron down icon Chevron up icon
New Features from Puppet 4 and 5 Chevron down icon Chevron up icon
Separation of Code and Data with Hiera Chevron down icon Chevron up icon
Puppet Roles and Profiles Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
(1 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 100%
Thomas Monte Oct 23, 2017
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
The book was hard
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.