Book description
Over 80 recipes to automate your cloud and server infrastructure with Chef and its associated toolset
Automate error-prone and tedious manual tasks and manage your servers on-site or in the cloud
Equip yourself with Chef components such as Chef client and solo, and learn how to create simple Chef cookbooks and various other artifacts for managing systems with Chef when live
Packed with working code and easy-to-follow, step-by-step instructions to configure, deploy, and scale your applications
In Detail
Chef is a configuration management tool that lets you automate your more cumbersome IT infrastructure processes and control a large network of computers (and virtual machines) from one master server.
This book takes you through covering the various artifacts of Chef and explains the techniques of building full-fledged real-world solutions. After describing how to use the basic Chef command-line tools such as knife and Berkshelf, the book will show you how to troubleshoot your work. It will also take you through the core concepts of managing users, applications, and your entire cloud infrastructure. This book will help you learn the techniques of the pros by walking you through a host of step-by-step guides to solve real-world infrastructure automation challenges.
Table of contents
-
Chef Infrastructure Automation Cookbook Second Edition
- Table of Contents
- Chef Infrastructure Automation Cookbook Second Edition
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Chef Infrastructure
- Introduction
- Using version control
- Installing the Chef development kit on your workstation
- Using the hosted Chef platform
- Managing virtual machines with Vagrant
- Creating and using cookbooks
- Inspecting files on your Chef server with knife
- Defining cookbook dependencies
- Managing cookbook dependencies with Berkshelf
- Downloading and integrating cookbooks as vendor branches into your Git repository
- Using custom knife plugins
- Deleting a node from the Chef server
- Developing recipes with local mode
- Using roles
- Using environments
- Freezing cookbooks
- Running Chef client as a daemon
- Using chef-shell
-
2. Evaluating and Troubleshooting Cookbooks and Chef Runs
- Introduction
- Testing your Chef cookbooks
- Flagging problems in your Chef cookbooks
- Test-driven development for cookbooks using ChefSpec
- Integration testing your Chef cookbooks with Test Kitchen
- Showing affected nodes before uploading cookbooks
- Overriding a node's run list to execute a single recipe
- Using why-run mode to find out what a recipe might do
- Debugging Chef client runs
- Inspecting the results of your last Chef run
- Raising and logging exceptions in recipes
- Diff-ing cookbooks with knife
- Using community exception and report handlers
- Creating custom handlers
-
3. Chef Language and Style
- Introduction
- Using community Chef style
- Using attributes to dynamically configure recipes
- Using templates
- Mixing plain Ruby with Chef DSL
- Installing Ruby gems and using them in recipes
- Using libraries
- Using definitions
- Creating your own Lightweight Resource Providers (LWRP)
- Extending community cookbooks by using application wrapper cookbooks
- Creating custom Ohai plugins
- Creating custom knife plugins
-
4. Writing Better Cookbooks
- Introduction
- Setting the environment variables
- Passing arguments to shell commands
- Overriding attributes
- Using search to find nodes
- Using data bags
- Using search to find data bag items
- Using encrypted data bag items
- Accessing data bag values from external scripts
- Getting information about the environment
- Writing cross-platform cookbooks
- Finding the complete list of operating systems you can use in cookbooks
- Making recipes idempotent by using conditional execution
-
5. Working with Files and Packages
- Introduction
- Creating configuration files using templates
- Using pure Ruby in templates for conditionals and iterations
- Installing packages from a third-party repository
- Installing software from source
- Running a command when a file is updated
- Distributing directory trees
- Cleaning up old files
- Distributing different files based on the target platform
-
6. Users and Applications
- Introduction
- Creating users from data bags
- Securing the Secure Shell Daemon (SSHD)
- Enabling passwordless sudo
- Managing NTP
- Managing nginx
- Creating nginx virtual hosts
- Creating MySQL databases and users
- Managing WordPress sites
- Managing Ruby on Rails applications
- Managing Varnish
- Managing your local workstation
-
7. Servers and Cloud Infrastructure
- Introduction
- Creating your infrastructure using Chef Provisioning
- Creating cookbooks from a running system with Blueprint
- Running the same command on many machines at once
- Setting up SNMP for external monitoring services
- Deploying a Nagios monitoring server
- Building high-availability services using heartbeat
- Using HAProxy to load-balance multiple web servers
- Using custom bootstrap scripts
- Managing firewalls with iptables
- Managing fail2ban to ban malicious IP addresses
- Managing Amazon EC2 instances
- Loading your Chef infrastructure from a file with spiceweasel and knife
- Index
Product information
- Title: Chef Infrastructure Automation Cookbook - Second Edition
- Author(s):
- Release date: May 2015
- Publisher(s): Packt Publishing
- ISBN: 9781785287947
You might also like
book
Chef: Powerful Infrastructure Automation
Learn Chef Provisioning like a boss and discover how to deploy software and manage hosts, along …
book
Test-Driven Infrastructure with Chef, 2nd Edition
Since Test-Driven Infrastructure with Chef first appeared in mid-2011, infrastructure testing has begun to flourish in …
book
Automation through Chef Opscode
Automation through Chef Opscode provides an in-depth understanding of Chef, which is written in Ruby and …
book
Mastering Chef Provisioning
Learn Chef Provisioning like a boss and finally own your infrastructure About This Book This is …