Puppet Best Practices

Design Patterns for Maintainable Code
 
 
O'Reilly (Verlag)
  • erschienen am 24. August 2018
  • |
  • 308 Seiten
 
E-Book | ePUB mit Adobe-DRM | Systemvoraussetzungen
978-1-4919-2304-7 (ISBN)
 
If you maintain or plan to build Puppet infrastructure, this practical guide will take you a critical step further with best practices for managing the task successfully. Authors Chris Barbour and Jo Rhett present best-in-class design patterns for deploying Puppet environments and discuss the impact of each. The conceptual designs and implementation patterns in this book will help you create solutions that are easy to extend, maintain, and support.Essential for companies upgrading their Puppet deployments, this book teaches you powerful new features and implementation models that werent available in the older versions. DevOps engineers will learn how best to deploy Puppet with long-term maintenance and future growth in mind.Explore Puppets design philosophy and data structuresGet best practices for using Puppets declarative languageExamine Puppet resources in depththe building blocks of state managementLearn to model and describe business and site-specific logic in PuppetSee best-in-class models for multitiered data management with HieraExplore available options and community experience for node classificationUtilize r10k to simplify and accelerate Puppet change managementReview the cost benefits of creating your own extensions to PuppetGet detailed advice for extending Puppet in a maintainable manner
  • Englisch
  • Sebastopol
  • |
  • USA
978-1-4919-2304-7 (9781491923047)

weitere Ausgaben werden ermittelt
  • Intro
  • Copyright
  • Table of Contents
  • Preface
  • What Is a Best Practice?
  • Who Should Read This Book
  • Why We Wrote This Book
  • A Word on Puppet Today
  • Navigating This Book
  • Online Resources
  • Conventions Used in This Book
  • Using Code Examples
  • O'Reilly Safari
  • How to Contact Us
  • Acknowledgments
  • Chapter 1. The Puppet Design Philosophy
  • Declarative Code
  • What Is Declarative Code, Anyway?
  • Resource Types and Providers
  • Procedural Example
  • Nondeclarative Code with Puppet
  • Idempotency
  • Side Effects
  • Resource-Level Idempotence
  • Run-Level Idempotence
  • Nondeterministic Code
  • Stateless
  • Benefits of Stateless Design
  • Sources of State Information
  • Summary
  • Chapter 2. High-Level Code and Data Design
  • Code and Data Organization
  • Code and Data Categories
  • Types of Code Logic
  • Examples of Logic Types
  • Mapping Data Types to Puppet Use Cases
  • Application Logic and Puppet Modules
  • Business Logic Should Not Be Written into Component Modules
  • Business Logic with Roles and Profiles
  • Business, Service, Site, Node, and Application Data
  • Hiera Data Sources
  • Node Classification
  • Summary
  • Chapter 3. Coding Practices
  • The Style Guide
  • Coding Principles
  • KISS: Keep It Simple
  • The Single Responsibility Principle
  • Separation of Concerns
  • Interface-Driven Design
  • DRY: Don't Repeat Yourself
  • Don't Reinvent the Wheel
  • Code Practices
  • Balance of Resources Versus Logic
  • Balance of Code Versus Data
  • Conditional Logic
  • Iteration
  • Generating Lists
  • Variables
  • Variable Naming
  • Referencing Variables
  • Other Variable Use Cases
  • Trusted Variables
  • Order of Assignment for Top-Level Variables
  • Assignment with Selectors
  • Attribute Values Chosen by Conditional Evaluation
  • Variable Inheritance
  • Strict Variables
  • Function Calls
  • Always Use Parentheses
  • Functions for Logging and Debugging
  • String Manipulation Functions
  • Path Manipulation
  • Input Validation Functions
  • Catalog Tests
  • Data Transformation
  • Templates
  • ERB Templates
  • EPP Templates
  • EPP Versus ERB
  • Other Language Features
  • Summary
  • Chapter 4. Puppet Module Design
  • The Puppet Development Kit
  • Installing the Puppet Agent
  • Using the Ruby that Comes Bundled with Puppet
  • Installing the Puppet Development Kit
  • Favor Editors or IDEs with Puppet Plugins
  • Using Vendor-Provided or Community Modules
  • Picking Good Modules
  • Module Checklist
  • Module Applicability to Your Needs
  • Contributing Modules
  • Designing Modules Well
  • Make Use of Module Structure
  • Keep the Module Focused
  • Design Modules for Public Consumption
  • Planning and Scoping Your Module
  • Basic Module Layout
  • The Module's Main Class
  • Module Parameters
  • Input Validation
  • Data in the Module
  • The params.pp Pattern
  • Hiera Data in Modules
  • Modularizing Classes
  • Dependencies
  • Class Relationships
  • Class Containment
  • Interfacing with Classes
  • Reusing Defined Types
  • Providing Clean Service Interfaces with Defined Types
  • Simplify Complex Operations with a Defined Type
  • Interacting with Other Resouces in the Module
  • Creating Useful Documentation
  • README, REFERENCE, and Other Markdown
  • REFERENCE Markdown
  • Summary
  • Chapter 5. Resources
  • Using Resources to Implement Change
  • Resource Types Abstract Implementation Details
  • Use the Most Specific Resource Type
  • Examining a Naked Resource
  • Exploring Resources with Tools
  • Resource Declaration
  • Ensure states
  • Use Variables for Data-Driven Declaration
  • Use Arrays for Similar Resources
  • Using Automatic Resource Relationships for Clean Code
  • Resource Declaration by Functions
  • Resources Metatypes
  • Resource Metaparameters
  • Avoid Parse-Order Problems by Using Virtual Resources
  • Exporting Resources
  • Overriding and Modifying Declared Resources
  • Resource Default Statements
  • Resource Chaining
  • Resource Collectors
  • Resource Best Practices
  • Custom Resource Types
  • Useful Defined Types
  • Summary
  • Chapter 6. Hiera Data
  • Separating Code and Data
  • Global, Environment, and Module Data
  • Hiera Backends
  • Designing the Hiera Hierarchy
  • Variable Interpolation
  • Design Guidelines
  • Useful Hierarchy Levels
  • Eliminating Data
  • Accessing Hiera
  • Automatic Parameter Lookups
  • Hiera Function Calls
  • Converting Serialized Hiera Data into Resource Declarations
  • Interpolation in Your Data
  • The Built-In Backends
  • YAML
  • JSON
  • HOCON
  • eYAML
  • Custom Hiera Backends
  • Database and NoSQL Engines
  • Service Discovery Backends
  • Encrypted Key/Value Storage
  • Summary
  • Chapter 7. Roles and Profiles
  • Roles
  • Creating Readable Roles
  • Design Roles for a Singular Use Case
  • Provide the Role for Use in Data Lookups
  • Profiles
  • A Sample Service Profile
  • Providing Actionable Data in Profile Parameters
  • Implementing Business Logic in Profiles
  • Defining Module Relationships in Profiles
  • Creating Metaprofiles to Group Configurations
  • Designing an Appropriate Profile Structure
  • Testing Roles and Profiles
  • Validating Profiles by Using Unit Tests
  • Confirming Profile Implementation with Acceptance Tests
  • Summary
  • Chapter 8. Node Classification
  • What Data Should the Node Classifier Provide?
  • Roles and Profiles
  • Node-Specific Data
  • Node Statements
  • Node Statement Matching
  • Replacing Node Inheritance
  • Node Parameters Within Node Blocks
  • Fact-Based Classification
  • Fact-Based Role Assignment
  • Security and Fact-Selected Roles or Profiles
  • Fact-Based Hiera Classification
  • Node Parameters with Hiera Classification
  • Avoiding Node Data in Manifests
  • Serverless Classification
  • ENCs
  • What Data Can an ENC Provide?
  • Puppet Management Consoles
  • Inventory and Infrastructure Management ENCs
  • Summary
  • Chapter 9. Release Engineering and r10k
  • Puppet Environments in Depth
  • Puppet Directory Environments
  • Selectable Blocks for Catalog Building
  • Environment Configuration
  • Environment Independence and Isolation
  • Deploying with r10k
  • What Does r10k Actually Do?
  • The Control Repository
  • Control Repository Branch Contents
  • r10k Configuration File
  • Puppetfile
  • r10k Deployment Walkthrough
  • Uses for r10k
  • Build Development Environments
  • Simplifying Acceptance Testing
  • Implement Continuous Integration, Delivery, and Deployment
  • Deploy Production Environments
  • Build and Package
  • Release Management Strategies with r10k
  • Stage/Production Branches
  • Single Branch (GitHub Flow)
  • GitFlow
  • Invoking r10k
  • Puppet Prerun Command
  • Deploying on Receipt of a WebHook
  • Orchestrating Deployments with MCollective/Choria
  • Invoking r10k in Testing Frameworks
  • Combining Multiple Invocation Methods
  • Migrating to r10k
  • Repository-per-Module Benefits
  • Configuring an Environment in the Control Repository
  • Enabling Monolithic and Per-module Hybrid Deployment
  • Moving Modules to their Own Repositories
  • Placing Roles and Profiles in the site/ Module Directory
  • Remove Fully Qualified Paths
  • Moving Shared Tools to Their Own Repository
  • Implementing Test Cases
  • Best Practices for Puppet Deployments
  • Using Repository Access Control to Enforce Deployment Policy
  • Enabling Multiteam Coordination
  • Pinning Module Versions
  • Isolating Puppet Extensions
  • Utilizing Standard Environment Configuration Practices
  • Git Best Practices
  • Deployment Practices
  • Summary
  • Chapter 10. Extending Puppet
  • The Cost of Extending Puppet
  • Minimizing Development Costs
  • Reducing Upgrade Costs
  • Testing
  • Static Code Analysis
  • Unit Testing
  • Acceptance Testing
  • Creating Facts
  • Distributing Facts in Modules
  • Facts Puppet Can't Know
  • Structured Facts
  • Abusing Facts
  • Trusted Certificate Attributes
  • Custom Types and Providers
  • Avoiding Creation of Duplicate Types
  • Creating a New Resource Type
  • Custom Resource Providers
  • Reuse Existing Frameworks
  • Creating Custom Hiera Backends
  • Choose the Appropriate Backend Type
  • Creating a High-Performance Backend
  • Using Puppet's Public Classes and Method Calls
  • Puppet Faces
  • Indirection
  • Deploying Extensions
  • pluginsync
  • Deploying Gem Dependencies
  • Deploying Ruby Gem Extensions on Puppet Server
  • Summary
  • Index
  • About the Authors
  • Colophon

Dateiformat: ePUB
Kopierschutz: Adobe-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)

Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet - also für "fließenden" Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein "harter" Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.

Bitte beachten Sie bei der Verwendung der Lese-Software Adobe Digital Editions: wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Als Download verfügbar

41,99 €
inkl. 7% MwSt.
E-Book Einzellizenz
ePUB mit Adobe-DRM
siehe Systemvoraussetzungen
E-Book bestellen