Mastering Chef Provisioning
eBook - ePub

Mastering Chef Provisioning

Earl Waud

Share book
  1. 262 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Chef Provisioning

Earl Waud

Book details
Book preview
Table of contents
Citations

About This Book

Learn Chef Provisioning like a boss and finally own your infrastructure

About This Book

  • This is the first Chef book focused on provisioning infrastructure as its sole task. The book offers a clear solution to a specific pain point: learn to make your system work faster.
  • Learning better approaches to load balancing and parallelization with this book will save you time
  • By mastering the techniques in this book, you will know how to run an entire fleet of machines without breaking a sweat
  • This book is more helpful than the documentation ( https://docs.chef.io/provisioning.html), with a stronger guiding voice and clearer explanations and use cases

Who This Book Is For

This book is for Software Engineers, System Administrators, or DevOps Engineers who need to quickly deliver reliably consistent infrastructure at scale. You are expected to have intermediate experience with Chef and Ruby and will be reading this book to advance your knowledge and take your skillset to the next level.

What You Will Learn

  • Use best practices to describe your entire infrastructure as code
  • Automate and document every aspect of your network, from the hardware of individual nodes to software, middleware, and all containers and clouds
  • Create a perfect model system
  • Make the best possible use of your resources and avoid redundancy
  • Deliver on the promise of Infrastructure as Code
  • Scale with ease by properly provisioning their infrastructure
  • Use the best Test Driven Development methodologies

In Detail

This book will show you the best practices to describe your entire infrastructure as code.

With the help of this book you can expand your knowledge of Chef because and implement robust and scalable automation solutions. You can automate and document every aspect of your network, from the hardware to software, middleware, and all your containers. You will become familiar with the Chef's Chef Provisioning tool. You will be able to make a perfect model system where everything is represented as code beneath your fingertips.

Make the best possible use of your resources, and deliver infrastructure as code, making it as versionable, testable and repeatable as application software

Style and approach

By dedicating a whole book solely to the question of provisioning, this book will teach administrators to use Chef as a birds-eye lens for their entire system. It will moves you away from the specifics of each machine and its automations and instead will teach you them how to approach the entire cluster as something different than the sum of its parts. By focusing on infrastructure as code as its own project, the book offers elegant, time-saving solutions for a perfectly described and automated network.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Chef Provisioning an online PDF/ePUB?
Yes, you can access Mastering Chef Provisioning by Earl Waud in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation en Ruby. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785888915

Mastering Chef Provisioning


Table of Contents

Mastering Chef Provisioning
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Setting Up a Development Environment on Your Workstation
Re-introducing Chef
What version of the Chef tools do I use?
References
Filling in the gaps in your Chef knowledge base
Major pieces of a Chef puzzle
The Chef client
The Ohai Chef tool
Recipes and cookbooks
Chef run lists
Chef roles
Chef resources
More things to consider
Data bags
Environments
The Chef supermarket
Chef Development Kit
Setting up an on-premise (private) Chef Server
References
Exploring the Chef Development Kit
The Chef Knife
Community tools
References
Installing Chef Development Kit
Downloading ChefDK
Installing ChefDK
Verifying ChefDK
References
Setting up a standard Chef repo
Using the Chef tool for Chef repo
The repo starter kit
Files for your .chef folder – a safer way
Growing your own tree
Self-signed certificates
References
What else do you need?
Using your favorite editor
Version control systems
Virtualization hypervisor
Vagrant
References
What is chef-apply?
Why is that useful?
References
Summary
2. Knife Tooling and Plugins
Knife help
References
Knife subcommands
Knife Bootstrap
Knife Node
Knife Diff
Knife Exec
Knife SSH
Knife Search
References
Knife to editor integration
Using the "wait" option
Does my editor require the wait option?
References
Knife Windows plugin
Installing the Knife Windows plugin
Bootstrapping a Windows node
Searching for Windows node data
References
Knife EC2 plugin
Installing the Knife EC2 plugin
Creating an EC2 instance
Bootstrapping an existing EC2 instance
Deleting EC2 instances
References
Creating new Knife plugins
The basic plugin file format
Example – A simpler EC2 Create Server plugin
References
Summary
3. Leveraging Roles, Environments, and Policies
Using Chef roles
How to create a role
Using per-environment run-lists in roles
Using nested roles
There is a downside to roles
References
Using Chef environments
The _default environment
Creating environments
Specifying cookbook versions in environments
References
Using Chef organizations
Creating organizations
Access control
References
Learning the attribute precedence hierarchy
Understanding attribute precedence factors
Resulting precedence hierarchy
Exploring policies
What exactly is a policy?
Why would I use a policy?
How do I use a policy?
Another example
How to specify the source options for cookbooks
What are the "Gotchas"?
References
Summary
4. Custom Resources
Out with the old (LWRPs), in with the new (Custom Resources)
What is the difference between the old way and the new way of defining resources?
What is a Custom Resource?
References
Creating an example use case
What is the goal?
Creating the cookbook
Creating the default recipe
The recipe worked, but what is missing?
References
Creating and using a Custom Resource
What makes up a Custom Resource?
Creating the "website" Custom Resource
Using our Custom Resource
References
Making a Custom Resource more reusable
Making a Custom Resource-only cookbook
Reuse the code from the "mywebapp" example
Using the reusable Custom Resource-only cookbook
Handling idempotence
References
Subclassing a Custom Resource
Convert our resource into a library module
Subclassing the library module Custom Resource
References
Summary
5. Provisioning in the Traditional Data Center
VMware provisioning
Installing the knife-vsphere plugin
Provisioning VMs using the knife-vsphere plugin
Cleaning up our vSphere and Chef environments
Using Chef with VMware and Vagrant
References
OpenStack provisioning
Setting up a DevStack OpenStack all-in-one environment
Deploying the DevStack Host VM
Downloading and installing DevStack
Downloading the demo project rc file and applying it
Adding the security rules to allow ping and ssh traffic
Installing the knife OpenStack plugin
Setting up the DevStack public key
Allocating some floating IP addresses to the project
Configuring the knife-openstack plugin knife settings
Adding a CentOS instance image to provision
Provisioning a new instance
References
Network automation
Automating juniper devices
Automating Cisco systems
Automating F5 LTMs
References
Summary
6. Provisioning in the Cloud
Provisioning AWS EC2 instances
Understanding EC2 authentication
Creating key pairs
Creating security groups
Installing Chef Server into an EC2 instance
References
Provisioning Microsoft Azure instances
Installing the knife-azure plugin
Configuring the plugin
Verifying the configuration
Generating public/private key pairs
Provisioning virtual machines
Provisioning a new Chef server into Azure
References
Provisioning in the Google Cloud platform
Installing and configuring the knife-google plugin
Creating and registering your key pairs
Provisioning virtual machines with the GCE
Deploying Chef server into a GCE instance
References
Looking at an honorable mention – Linode
References
Provisioning containers in Docker
Setting up a Docker server to host our containers
Installing and using Docker on our Chef Workstation
Using the knife-docker plugin
References
Summary
7. Test-Driven Development
Analyzing cookbooks with RuboCop
Using RuboCop
Examining the RuboCop output
Customizing RuboCop
References
Analyzing cookbooks with Foodcritic
Using Foodcritic
Examining the Foodcritic output
Customizing Foodcritic
References
Unit testing with ChefSpec
Using ChefSpec
Expanding our tests
References
Integration testing with Kitchen and ServerSpec
Preparing our tests
Kitchen create
Kitchen converge
Kitchen verify
References
Summary
8. Using Chef Provisioning
What is Chef provisioning?
It's highly idempotent
A hypothetical example
References
How to use Chef Provisioning
Chef Provisioning resources
A Vagrant example
A cloud example with AWS
A Docker example
References
Summary
Index

Mastering Chef Provisioning

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publish...

Table of contents