Customizing Chef - Jon Cowie

Customizing Chef

Getting the Most Out of Your Infrastructure Automation

(Autor)

Buch | Softcover
388 Seiten
2014
O'Reilly Media (Verlag)
978-1-4919-4935-1 (ISBN)
35,90 inkl. MwSt
Learn how to customize Chef by examining the internal structure this configuration management tool and navigating its source code. This practical book also shows you how to integrate external tooling with Chef via the API, and takes a look at more advanced customization.
Take advantage of Chef’s highly customizable design to tackle specific automation issues that you can’t solve by simply using Chef’s tools, resources, and services out of the box. With this practical guide, you’ll examine the internal structure of this configuration management technology and learn where, how, and why to add custom code.

Author Jon Cowie not only provides code snippets and practical advice for customizing Chef, but also helps you determine case by case whether it’s in your best interests to customize at all. If you have intermediate-to-advanced Chef experience, this book is indispensable.

  • Explore Chef’s typical setups and why you’d want to customize them
  • Learn the Ruby concepts needed to write customizations
  • Customize the Chef run process and explore Chef’s internal classes
  • Gain more insight into your Chef runs through handlers and Chef’s event stream
  • Level up your Chef recipes by writing your own resources and providers
  • Create and extend plugins for Knife—Chef’s command-line tool
  • Interact with the Chef API to write scripts and reports
  • Learn how to contribute customizations to the Chef community

Jon Cowie is a senior operations engineer at Etsy where he mixes his love of both coding and operations to try and solve interesting problems. He has created and open sourced a number of projects, including the Chef tools knife-spork and knife-preflight, and has spoken at several of O'Reilly's Velocity conferences.

Chef and Ruby 101
Chapter 1Introduction
What Is Configuration Management?
So Why Chef?
Think Critically
Meet AwesomeInc
Criteria for Customization
State of the Customization Nation
Chef Installation Types and Limitations
Prerequisites
Assumptions
Chapter 2Just Enough Ruby to Customize Chef
Ruby Is Object-Oriented
Ruby Is Dynamically Typed
Classes
Variable Scoping
Inheritance
Modules
Using Other Classes and Modules
When Things Go Wrong
Tying It All Together
Summary
Chapter 3Chef Internals
Chef Architecture
Anatomy of a Chef Run
Dry-Run and Why-Run
Using the Source
Tracing a chef-client Run
Summary
Customizing Chef Runs
Chapter 4Extending Ohai
Introduction
Ohai Example 1: Plugin Skeleton
Testing and Running Ohai Plugins
Ohai Example 2: Adding More to the Plugin
Ohai Example 3: Multilevel Plugins
Summary
Chapter 5Creating Handlers
Preparing a Test Environment
Introduction to Handlers
The Run Status Object
Handler Example 1: Start Handler
Handler Example 2: Report Handler
Handler Example 3: Exception Handler
Handlers: Summary and Further Reading
Chapter 6Extending Chef Run Events
Introduction to the Event Dispatcher
Event Dispatcher Initialization
Publish Overview
Subscribe Overview
Creating Formatters
Creating Custom Subscribers
Revisiting AwesomeInc—Which Customization?
Summary
Customizing Recipes
Chapter 7Definitions and Libraries
Cookbook Structure Revisited
Creating a Test Environment
Definitions
Libraries
Chapter 8Lightweight Resources and Providers
Introduction to Resources and Providers
Introduction to LWRPs
LWRP Example 1: Getting Started with LWRPs
The LWRP Domain-Specific Language
LWRP Example 2: Extending the Provider
Provider Internals
LWRP Example 3: Native Provider
Summary and Further Reading
Chapter 9Heavyweight Resources and Providers
Introduction to HWRPs
HWRP Example 1: Getting Started with HWRPs
Advanced HWRP Tricks
HWRP Example 2: Extending the package Resource
Summary and Further Reading
Other Customizations
Chapter 10Customizing Knife
The Knife Source Code
Introduction to Knife Plugins
Anatomy of a Knife Command
Creating a Test Environment
Knife Example 1: Wrapping an Existing Plugin
Presenting Presenters!
The UI Class
Knife Example 2: Search Plugin
Working with Chef Objects
Knife Example 3: Tying It All Together
Revisiting AwesomeInc—Plugin Best Practices
Summary and Further Reading
Chapter 11The Chef API
Introduction to the Chef API
Creating a Test Environment
API Example 1: Authenticating and Making a GET Request
The Chef::Rest Class
API Example 2: Combining Multiple API Requests
Error Handling
Secrets of the Chef API
Summary and Further Reading
Chapter 12Contributing Your Customizations
Documentation
Supporting Your Code
Managing Contributions
Testing Your Software
Versioning Your Software
Licensing and Copyright
Distributing Your Customizations
Summary
Appendix Chef API Endpoints and Verbs

Verlagsort Sebastopol
Sprache englisch
Maße 181 x 232 mm
Gewicht 628 g
Einbandart kartoniert
Themenwelt Mathematik / Informatik Informatik Netzwerke
Informatik Programmiersprachen / -werkzeuge Ruby
ISBN-10 1-4919-4935-X / 149194935X
ISBN-13 978-1-4919-4935-1 / 9781491949351
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich