Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Puppet 8 for DevOps Engineers
Puppet 8 for DevOps Engineers

Puppet 8 for DevOps Engineers: Automate your infrastructure at an enterprise scale

eBook
€26.99
Paperback
€33.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
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Puppet 8 for DevOps Engineers

Puppet Concepts and Practices

This chapter will focus on the origins of Puppet, why it was created, and how it is used in DevOps engineering. It will look at Puppet’s approach to configuration management and how its declarative approach differs from more regular procedural languages. Puppet has many features that are common in other languages such as variables, conditional statements, and functions. But in this chapter, we will cover the key terms, structure, and ideas of the language that make it different and how the underlying platform runs. We will give a clear, high-level overview of its approach and how it relates to customer needs and infrastructure environments. Finally, as there are a lot of preconceptions regarding Puppet, this chapter will finish by addressing some of the most common ones, including where they come from, and unwrap them.

This should ensure a fundamental understanding of Puppet and its approach before we build up a deeper, technical understanding of the language in upcoming chapters. It will also ensure this book is not just about technology but how genuine value can be delivered to customers using the service that Puppet provides.

In this chapter, we are going to cover the following main topics:

  • Puppet’s history and relationship to DevOps
  • Puppet as a declarative and idempotent language
  • Key terms in the Puppet language
  • Puppet as a platform
  • Common misconceptions

Puppet’s history and relationship to DevOps

Puppet was started by creator and founder Luke Kanies, who was working as a sysadmin and consultant. He was unable to find the tooling he wanted to use and that his customers could rely on, so he created Puppet as a Ruby-based open source configuration management language in 2005. The success of this open source project resulted in the release of a commercial offering, Puppet Enterprise, in February 2011. But as the demands increased and Puppet needed to reform and expand as both a company and an open source project, Luke stood down, stating that the challenges of growing Puppet to enterprise-scale were far from what I love to do most, and far from my core skills. We need to scale, and we need to execute.

The new leadership that followed took a direction that saw the company develop its professional services, and focus more effort on developer tooling and education while expanding its product range both organically and via acquisitions, striking a difficult balance between the open source community and its enterprise customer demands. Puppet was acquired by Perforce Software on May 17, 2022, following the Chef (2020) and Ansible (2015) acquisitions, as the last of the standalone configuration management start-ups. Luke summed up the change that has taken place in the industry: DevOps teams are different now. Companies are looking for a complete solution, rather than wanting to integrate individual best-of-breed vendors.

This history has seen Puppet move from a tool that left it to the developer to decided how best to use it to solve problems to, today, a tool with patterns and solutions that users can just consume to standardize their automation and deployment. This has allowed users to focus on their solutions and not the underlying technology.

DevOps itself has become a frustrating term in the IT industry; the definition given by formal sources differs hugely from how companies actually use it, and references to it can be used as a cynical buzzword or sales gimmick. The focus of this book is on DevOps engineering, as used particularly by large companies and has been well researched and discussed in studies such as the Puppet-run State of DevOps Report. DevOps engineering is normally delivered as part of projects such as digital transformations, cloud-first migrations, and various other modernization projects. What is typically seen in these projects is a desire to automate self-service deployment, compliance, and remove toil. This approach follows the DevOps goal of breaking down the silos between developers and ops teams by allowing better communication and establishing shared goals. What is noticeable is that the system administrator role in which Luke worked originally has effectively been replaced by roles such as DevOps engineers.

Puppet will be used as part of a DevOps toolchain, and Figure 1.1 shows an example set of tools and their relative functions. It is typical for Puppet to start its role at the end of a provisioning pipeline, as infrastructure is stood up in a platform and needs to be configured and enforced:

Figure 1.1 – A DevOps toolset

Figure 1.1 – A DevOps toolset

This book will focus not just on a technological understanding but also on how to use the maturity of the Puppet language, tooling, and platform with opinionated patterns. These approaches have been developed through years of customer engagements for Puppet and the communities’ own implementations to allow users to reduce their effort in finding the right approach, focus on their solutions, and deliver immediate benefit and return to their customers.

Puppet as a declarative and idempotent language

The first important thing to understand is how Puppet differs from normal scripting or coding languages. Puppet is declarative, meaning you describe the state you want the system to be in. For example, you could describe that your system should have a user called username with UID 1234, a configuration file should not exist, and a kernel setting should be at a particular value. In comparison to most languages where you have to describe the process to get to the state, Puppet’s approach brings us closer to how customers request services. They don’t want to know how it’s done, just that it will meet their requirements. These resource definitions can be saved in your version control system. Often, this approach is described as being part of Infrastructure as Code.

Puppet is idempotent, meaning that it will only make the changes required to get into the declared state. Meanwhile, most procedural languages will run steps every time and, typically, require various checks such as if statements to be added to make checks to avoid duplication. This is particularly powerful as what is called enforcement can be run with the Puppet language, ensuring the state you declared has been reached, and is capable of detecting whether a change happened because of you updating the state you wished the machine to be in or whether it was a change that happened on the machine itself moving away from the desired state. This can greatly assist with audits and avoid any configuration drifts in an estate and ensure change is managed and deliberate.

Puppet is OS-independent; the language is focused on the state, not the underlying implementation of how particular OSes install a package or add a user. This gives us a universal language that is independent of any underlying implementations, allowing for less duplication of code, avoiding the need to use layers of case/if statements to detect differences, and allowing multiple language implementations such as PowerShell for Windows and Bash for Unix-based systems. Additionally, it makes it easier to recover after failures in applying code. If in a procedural language, a step fails, it might not be safe to run the script in full again depending on how well the check steps have been coded. In contrast, Puppet code is able to resume only performing the steps it needs to reach the correct state.

A simple example of Puppet code to create a user would look like this:

user { 'david'
  uid => '123'
}

In contrast, a shell script might have a section like this:

if ! getent passwd david; then
  useradd -u 123 david
elif ! $(uid david) == 123; then
  usermod -u 123 david
fi

In the preceding shell example, we have to check whether a user exists, and if not, create one. If it does exist, then does it have the right UID? If not, we change it. This script only covers OSes that can use useradd and usermod. To achieve compatibility with multiple OSes, we would need a test to detect the OS type and produce a section of code like this for every OS or group of OSes and their required commands. Often, it would be more practical to write in multiple languages and scripts to cover a broader base of OS flavors, that is, if we wanted to cover both Unix and Windows, for example.

This compares to the Puppet declaration, which will work on multiple OSes without change as Puppet will detect the required commands and perform all the necessary state checks as part of that.

This example is all just for a single resource with a single attribute. You can quickly see how the shell script example will not scale as it becomes increasingly complex with almost endless checks and options.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the core concepts and best approaches to the latest version of the Puppet language
  • Learn the key components of the Puppet platform and see how they deploy and apply Puppet code to infrastructure
  • Discover approaches to collaborative working by using the right structure of code and deployment

Description

As DevOps and platform engineering drive the demand for robust internal development platforms, the need for infrastructure configuration tools has never been greater. Puppet, a powerful configuration management tool, is widely used by leading enterprises and boasts a thriving open source community. This book provides a comprehensive explanation of both the Puppet language and the platform. It begins by helping you grasp the basic concepts and approach of Puppet as a stateful language, and then builds up to explaining how to structure Puppet code to scale and allow flexibility and collaboration among teams. As you advance, you’ll find out how the Puppet platform allows the management and reporting of infrastructure configuration. The book also shows you how the platform can be integrated with other tooling, such as ServiceNow and Splunk. The concluding chapters help you implement Puppet to fit in heavily regulated and audited environments as well as modern hybrid cloud environments. By the end of this book, you’ll have gained a solid understanding of the capabilities of both the Puppet language and platform, and you will have learned how to structure and scale Puppet to create a platform to provide enterprise-grade infrastructure configuration.

Who is this book for?

This book is for DevOps engineers looking to automate infrastructure with Puppet as a configuration management tool. It will allow both beginners and current Puppet users to understand the full power of the Puppet language and platform. A basic understanding of Unix system administration and Windows systems and core development concepts such as revision control tools like git, virtualization, testing, and coding tooling like vi or Visual Studio code is a prerequisite.

What you will learn

  • Find out how to structure Puppet code and data to scale and be secure
  • Discover the core components of the Puppet platform and how to achieve performance
  • Get to grips with classifying infrastructure and deploying code for different environments
  • Understand how Bolt can provide procedural orchestration alongside Puppet code
  • Use Puppet's integrations and Forge modules that allow Puppet to integrate with other systems
  • Adopt approaches to adoption to ensure your Puppet implementation will succeed in regulated environments, the cloud, and with change control

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 28, 2023
Length: 416 pages
Edition : 1st
Language : English
ISBN-13 : 9781803235455
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 feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Jun 28, 2023
Length: 416 pages
Edition : 1st
Language : English
ISBN-13 : 9781803235455
Concepts :
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 113.97
Puppet 8 for DevOps Engineers
€33.99
Mastering Kubernetes
€41.99
Terraform Cookbook
€37.99
Total 113.97 Stars icon

Table of Contents

21 Chapters
Part 1 – Introduction to Puppet and the Basics of the Puppet Language Chevron down icon Chevron up icon
Chapter 1: Puppet Concepts and Practices Chevron down icon Chevron up icon
Chapter 2: Major Changes, Useful Tools, and References Chevron down icon Chevron up icon
Chapter 3: Puppet Classes, Resource Types, and Providers Chevron down icon Chevron up icon
Chapter 4: Variables and Data Types Chevron down icon Chevron up icon
Chapter 5: Facts and Functions Chevron down icon Chevron up icon
Part 2 – Structuring, Ordering, and Managing Data in the Puppet Language Chevron down icon Chevron up icon
Chapter 6: Relationships, Ordering, and Scope Chevron down icon Chevron up icon
Chapter 7: Templating, Iterating, and Conditionals Chevron down icon Chevron up icon
Chapter 8: Developing and Managing Modules Chevron down icon Chevron up icon
Chapter 9: Handling Data with Puppet Chevron down icon Chevron up icon
Part 3 – The Puppet Platform and Bolt Orchestration Chevron down icon Chevron up icon
Chapter 10: Puppet Platform Parts and Functions Chevron down icon Chevron up icon
Chapter 11: Classification and Release Management Chevron down icon Chevron up icon
Chapter 12: Bolt for Orchestration Chevron down icon Chevron up icon
Chapter 13: Taking Puppet Server Further Chevron down icon Chevron up icon
Part 4 – Puppet Enterprise and Approaches to the Adoption of Puppet Chevron down icon Chevron up icon
Chapter 14: A Brief Overview of Puppet Enterprise Chevron down icon Chevron up icon
Chapter 15: Approaches to Adoption Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(5 Ratings)
5 star 80%
4 star 20%
3 star 0%
2 star 0%
1 star 0%
Aaron Russo Jul 05, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book covers a wide range of topics from puppet architecture to testing and most things in between, and found it to be a good book on current Puppet to introduce its concepts and ideas to my team of mostly new Puppet users, as well as being a reference for more experienced users.NOTE: My initial review was a bit critical of the Puppet 8 references being a bit inconsistent, but sounds like that was a publishing issue and new copies purchased have fixed that.
Amazon Verified review Amazon
Nick Moore Jul 05, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Puppet is by far and away the most powerful automation tool on the market. With great power comes great responsibility! This book is a must for any DevOps engineers who want to spend their time working on the fun parts of their jobs, whilst automating away the pain via Puppet technology. Fantastically written, by someone who grew up in the financial industry using Puppet. Some very good tips and lessons learned that even seasoned Puppet veterans could learn from. Five stars.
Amazon Verified review Amazon
Tiny Aug 19, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A good intoduction to Puppet although I wish the Puppet 8 approaches were a little better integrated into the text of the book. I found the section on Bolt, as an agentless orchestrator to work in connection with Puppet to particularly helpful. Also nice was having a lab section rather than merely questions at the end of the chapter to help bring up one's own browser and move forward.
Amazon Verified review Amazon
ps258 Jun 29, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Absolutely the best Puppet book I've ever owned or read.
Amazon Verified review Amazon
Robert Waffen Jul 11, 2023
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Dieses Buch hilft einem gut dabei in Puppet einzusteigen. Es vermittelt einen die Grundkonzepte und erklärt diese immer anschaulich an Code-Beispielen. Für Menschen die von früheren Puppet Versionen umsteigen zeigt es gut die Änderungen dieser bis hin zu Puppet 8 auf. Der Schreibstil ist auch sehr angenehm zu lesen und die Sätze sind nicht überkompliziert gestaltet, wie es z.B. in so manch anderem Fachbuch oft vorkommt.Mir hat es sehr gefallen und ich kann es empfehlen.Als Kritik muss ich aber leider noch äussern, das die abgedruckten Code-Beispiele oft gegen den Puppet-eigenen Code-Guideline verstoßen und etwas zusammengewürfelt wirken. Diese hätten echt ein wenig mehr Liebe gebraucht. Auch sind hier und da einige kleine Syntax-Fehler zu finden. Was aber nicht deren Zweck, etwas zu veranschaulichen mindert.--- EnglishThis book is very helpful for getting started with Puppet. It conveys the basic concepts and explains them using code examples that are always presented in a clear manner. For people transitioning from earlier versions of Puppet, it effectively highlights the changes up to Puppet 8. The writing style is also very pleasant to read, and the sentences are not overly complicated, which is often the case in other technical books.I really enjoyed it and can recommend it.However, as a criticism, I have to mention that the printed code examples often violate Puppet's own code guidelines and seem somewhat haphazardly put together. They could have used a bit more attention to detail. Additionally, there are some minor syntax errors here and there. However, this doesn't diminish their purpose of illustrating concepts.
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.