Extending Puppet - Second Edition
eBook - ePub

Extending Puppet - Second Edition

Alessandro Franceschi, Jaime Soriano Pastor

Compartir libro
  1. 316 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Extending Puppet - Second Edition

Alessandro Franceschi, Jaime Soriano Pastor

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Start pulling the strings of your infrastructure with Puppet – learn how to configure, customize, and manage your systems more intelligently

About This Book

  • Explore the wider Puppet ecosystem of useful tools
  • Design and manage your Puppet architecture for optimum performance
  • Write more efficient code that keeps your infrastructure more robust

Who This Book Is For

If you are a Puppet user, this book will help you on different levels. If you a beginner, we summarize the key Puppet components and give you the elements to have a broader vision. For more experienced users, you will be surprised by with topics on designing, implementing, adapting, and deploying Puppet architectures. If you are expert, you will find topics and information that is rarely exposed in other books, giving you an insight into Puppet's future and its usage on alternative devices.

What You Will Learn

  • Learn the principles of Puppet language and ecosystem
  • Extract the features of Hiera and PuppetDB's power usage
  • Explore the different approaches to Puppet architecture design
  • Use Puppet to manage network, cloud, and virtualization devices
  • Manage and test the Puppet code workflow
  • Tweak, hack, and adapt the Puppet extension points
  • Get a run through of the strategies and patterns to introduce Puppet automation
  • Master the art of writing reusable modules

In Detail

Puppet has changed the way we manage our systems, but Puppet itself is changing and evolving, and so are the ways we are using it. To tackle our IT infrastructure challenges and avoid common errors when designing our architectures, an up-to-date, practical, and focused view of the current and future Puppet evolution is what we need. With Puppet, you define the state of your IT infrastructure, and it automatically enforces the desired state.

This book will be your guide to designing and deploying your Puppet architecture. It will help you utilize Puppet to manage your IT infrastructure. Get to grips with Hiera and learn how to install and configure it, before learning best practices for writing reusable and maintainable code. You will also be able to explore the latest features of Puppet 4, before executing, testing, and deploying Puppet across your systems. As you progress, Extending Puppet takes you through higher abstraction modules, along with tips for effective code workflow management.

Finally, you will learn how to develop plugins for Puppet - as well as some useful techniques that can help you to avoid common errors and overcome everyday challenges.

Style and approach

This is a collection of specific information about multiple topics related to Puppet and its ecosystem. Starting from a review of the very basics to more advanced topics, mixing practical advice with important theory and broader perspective, along with implementation details.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Extending Puppet - Second Edition un PDF/ePUB en línea?
Sí, puedes acceder a Extending Puppet - Second Edition de Alessandro Franceschi, Jaime Soriano Pastor en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming in Ruby. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2016
ISBN
9781785885686
Edición
2

Extending Puppet Second Edition


Table of Contents

Extending Puppet Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Puppet Essentials
The Puppet ecosystem
Why configuration management matters
Puppet components
Installing and configuring Puppet
Puppet in action
Resources
The resource abstraction layer
Nodes
Classes and defines
Class inheritance
Resource defaults
Resource references
Variables, facts, and scopes
System's facts
External facts
User variables in Puppet DSL
Type-checking
User variables in an ENC
User variables in Hiera
Puppet built-in variables
Variables scope
Meta parameters
Managing order and dependencies
Run stages
Reserved names and allowed characters
Conditionals
Comparison operators
Iteration and lambdas
The in operator
Expressions combinations
Exported resources
Virtual resources
Modules
Paths of a module and auto loading
Templates
Restoring files from a filebucket
Summary
2. Managing Puppet Data with Hiera
Installing and configuring Hiera
The hiera.yaml configuration file
Global settings
Backend specific settings
Examples
Working with the command line on a YAML backend
Using Hiera in Puppet
Dealing with hashes in Puppet code
Puppet 3 automatic parameter lookup
Evolving usage patterns for class parameters
Additional Hiera backends
Hiera-file
Encryption plugins
Hiera-gpg
Hiera-eyaml
Hiera-http, hiera-mysql
Using Hiera as an ENC
Summary
3. Introducing PuppetDB
Installation and configuration
Installing PuppetDB
PuppetDB configurations
Init script configuration
Configuration settings
Logging configuration
Configurations on the Puppet Master
Dashboards
PuppetDB performance dashboard
Puppetboard—Querying PuppetDB from the Web
PuppetDB API
Querying PuppetDB (read)
PuppetDB commands (write)
Querying PuppetDB for fun and profit
/facts endpoint
/resources endpoint
/nodes endpoint
/catalogs endpoint
/fact-names endpoint
/metrics endpoint
/reports endpoint
/events endpoint
/event-counts endpoint
/aggregated-event-counts endpoint
/server-time endpoint
/version endpoint
The puppetdbquery module
Query format
Querying from the command line
Querying from Puppet manifests
The PuppetDB Hiera backend
How Puppet code may change in the future
Summary
4. Designing Puppet Architectures
Components of a Puppet architecture
Definition of the classes to include in each node
Definition of the parameters to use for each node
Definition of the configuration files provided to the nodes
Definition of custom resources and classes
The Foreman
Roles and profiles
The data and the code
Sample architectures
The default approach
Basic ENC, logic on site module, Hiera backend
The Foreman and Hiera
Hiera-based setup
Foreman smart variables
Facts-driven truths
Nodeless site.pp
Summary
5. Using and Writing Reusable Modules
Modules layout evolution
Class parameters—from zero to data bindings
Params pattern
Data in modules
Files and class names
The anchor pattern
The parameters dilemma
Naming standards
Reusability patterns
Managing files
Managing configuration hash patterns
Managing multiple configuration files
Managing users and dependencies
Managing installation options
Managing extra resources
Summary
6. Higher Abstraction Modules
The OpenStack example
Component (application) modules
Raising abstraction – the official OpenStack module
Raising abstraction – Puppet Labs OpenStack module
Taking an alternate approach
An approach to reusable stack modules
Tiny Puppet
Summary
7. Puppet Migration Patterns
Examining potential scenarios and approaches
New infrastructures
Existing manually managed infrastructures
Node migration
Node update
Existing automated infrastructures
Patterns for extending Puppet coverage
Raising the bar, step by step
Knowing the territory
Defining priorities
Evaluating solutions
Coding
Applying changes
Things change
Puppet friendly infrastructure
Puppet-friendly software
Summary
8. Code Workflow Management
Write Puppet code
Geppetto
Vim
Git workflows
Code management using Git
Git hooks
Environments and branches
Branch based automatic environments
Simplified developer workdir environments
Code review
Gerrit
Online resources for peer review
Testing Puppet code
Using rspec-puppet
Vagrant
Beaker and beaker-rspec
Deploying Puppet code
Using librarian-puppet for deployments
Deploying code with r10k
Propagating Puppet changes
Puppet continuous integration
Travis
Jenkins
Summary
9. Scaling Puppet Infrastructures
Scaling Puppet
As simple as puppet apply
Default Puppet Master
Puppet Master with Passenger
Installing and configuring Passenger
Puppet Master based on Trapperkeeper
Multi-Master scaling
Managing certificates
Managing SSL termination
Managing code and data
Load balancing alternatives
Masterless Puppet
Configurations and infrastructure optimizations
Traffic compression
Caching
Distributing Puppet run times
File system changes check
Scaling stored configs
Measuring performance
Puppet Metrics
Optimizing code
Testing different Puppet versions
Summary
10. Extending Puppet
Anatomy of a Puppet run, under the hood
Puppet extension alternatives
ENC and Hiera Extendibility
Modules pluginsync
Puppet indirector and its termini
Custom functions
Custom facts
Ruby facts distributed via pluginsync
External facts in facts.d directory
Custom types and providers
Custom report handlers
Custom faces
Summary
11. Beyond the System
Puppet on network equipment
Proxy mode with Puppet device application
Native Puppet on network equipment
Cisco onePK
Juniper and the netdev_stdlib
Puppet for cloud and virtualization
VMware
VM provisioning on vCenter and vSphere
vCenter configuration
vSphere virtual machine management with resource types
Amazon Web Services
Cloud provisioning on AWS
AWS provisioning and configuration with resource types
Managing CloudFormation
Cloud provisioning on Google Compute Engine
Puppet on storage devices
Puppet and Docker
Summary
12. Future Puppet
Changing the serialization format
Direct Puppet
File sync
Other changes
Certificate authority in Clojure
Package management...

Índice