Book Image

Puppet 8 for DevOps Engineers

By : David Sandilands
Book Image

Puppet 8 for DevOps Engineers

By: David Sandilands

Overview of this book

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.
Table of Contents (22 chapters)
1
Part 1 – Introduction to Puppet and the Basics of the Puppet Language
7
Part 2 – Structuring, Ordering, and Managing Data in the Puppet Language
12
Part 3 – The Puppet Platform and Bolt Orchestration
17
Part 4 – Puppet Enterprise and Approaches to the Adoption of Puppet

What this book covers

Chapter 1, Puppet Concepts and Practices, focuses on why Puppet was developed, how it has changed over time, and the core concepts and practices of Puppet. It also focuses on how Puppet assists in a DevOps transformation and our approach to it.

Chapter 2, Major Changes, Useful Tools, and References, discusses major changes such as harmful terminology, sensitive values, deferred functions, and other high-level items that have emerged since Puppet 5. It will also highlight items that have dropped out of Puppet. It will cover useful tools to assist development, such as VS Code and the Puppet Development Kit (PDK), showing how the lab and development environment will work for the book. It will also show various Puppet and community references for further learning.

Chapter 3, Puppet Classes, Resource Types, and Providers, introduces the most basic building blocks of Puppet and how to use them so you can understand the initial stages of writing Puppet code, showing how resource types and providers work together to create stateful code independent of the underlying OS implementation and how classes allow us to group these resources.

Chapter 4, Variables and Data Types, details how to assign variables with data types in Puppet, how they can be managed in arrays and hashes, the use of the sensitive data type to secure variables, and how the variable scope is managed. Then, we’ll provide some best practice advice on how to use these variables and data structures well within Puppet.

Chapter 5, Facts and Functions, looks at the facts and factors that it provides, how to use them in Puppet code, and how to customize them. It will also look at functions: what they are, how lambdas can be used with them, and how the relatively recent deferred functions can be used with them

Chapter 6, Relationships, Ordering, and Scope, covers how Puppet handles relationships and order as well as scope and containment. These issues come together to help the user understand how cross-module or cross-class resources and variables will intersect.

Chapter 7, Templating, Iterating, and Conditionals, shows how to use templates, iteration, loops, and various conditional statements, such as if cases and selectors to affect the flow and management of code.

Chapter 8, Developing and Managing Modules, discusses the structure of modules, the use of the PDK to create them, and how we can test modules. It will also discuss how to use Puppet Forge well to both consume and share code and understand the quality of shared modules.

Chapter 9, Handling Data with Puppet, runs through how Puppet handles data, discussing what Hiera is, at what levels to store data, and some pitfalls and mistakes to avoid in structure and approach.

Chapter 10, Puppet Platform Parts and Functions, helps you understand what Puppet is as a platform, how the various components work together and communicate, and common architecture approaches to deliver scale.

Chapter 11, Classification and Release Management, discusses how Puppet manages servers and code in environments, how servers can be classified, and how the Puppet run of this classification actually runs. The tooling to deploy code into these environments will also be discussed.

Chapter 12, Bolt for Orchestration, looks at how to use Bolt as an orchestrator for procedural tasks, showing the various transport options – SSH, WinRM, and PCP – to use via Puppet agents. You will see how tasks and plans can complement Puppet code and how Puppet code can be orchestrated and deployed via Bolt itself.

Chapter 13, Taking Puppet Server Further, looks at more advanced topics to ensure you can monitor and scale your infrastructure, deal with common issues, and integrate external data sources.

Chapter 14, A Brief Overview of Puppet Enterprise, highlights the differences between Puppet Enterprise compared to open source, and the integrations and services available to help scale and tune infrastructure.

Chapter 15, Approaches to Adoption, discusses how Puppet can be adopted and worked with in real brownfield environments, highlighting lessons learned in the field and from various adoptions, and looking at correctly scoping use cases to benefit from delivering regularly. It will look at how Puppet can work within platform engineering as well as with heritage estates, and even in highly regulated and change-managed estates.