You are previewing Automation through Chef Opscode.
O'Reilly logo
Automation through Chef Opscode

Book Description

Automation through Chef Opscode provides an in-depth understanding of Chef, which is written in Ruby and Erlang for configuration management, cloud infrastructure management, system administration, and network management.

Targeted at administrators, consultants, and architect, the book guides them through the advanced features of the tool which are necessary for infrastructure automation, devops automation, and reporting. The book presumes knowledge of Ruby and Erlang which are used as reference languages for creating recipes and cookbooks and as a refresher on them to help the reader get on speed with the flow of book.

The book provides step by step instructions on installation and configuration of Chef, usage scenarios of Chef, in infrastructure automation by providing common scenarios like virtual machine provisioning, OS configuration for Windows, Linux, and Unix, provisioning and configuration of web servers like Apache along with popular databases like MySQL.

It further elaborates on the creation of recipes, and cookbooks, which help in deployment of servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure.

The books covers advanced features like LWRPs and Knife and also contains several illustrative sample cookbooks on MySQL, Apache, and CouchDB deployment using a step by step approach.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Authors
  8. About the Technical Reviewers
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: Introduction
    1. Infrastructure as Code
    2. Overview
      1. Nodes
      2. Workstation
      3. Server
    3. The Value of Chef
    4. Why Chef?
    5. Core Principles of Chef
      1. Idempotence
      2. Thick Client, Thick Server
      3. Order of Execution
    6. Who Uses Chef?
    7. Key Technologies
      1. Ruby
      2. Erlang
  12. Chapter 2: The Chef Server
    1. The Chef Server
      1. Types of Chef Server
      2. Extra Functionalities in Enterprise Chef
      3. Components of Open Source Chef Server
  13. Chapter 3: Installation
    1. Install the Chef Server
      1. Prerequisite
      2. Installation
      3. Installation on a Virtual Machine
      4. File System locations
    2. Configuration
      1. Optional Settings
  14. Chapter 4: Workstation
    1. Prerequisite
      1. Operating System Support
      2. Install and Configure a Workstation
  15. Chapter 5: Nodes
    1. Types of Nodes
    2. Node Names
    3. Manage Nodes
      1. Chef Client
      2. The Chef Run
    4. Install and Configure the Node
      1. Identify the Operating System
      2. Bootstrap
      3. Configuring
  16. Chapter 6: Working with Knife
    1. Working with Knife
      1. Bootstrap
      2. Client
      3. Configure
      4. Cookbook
      5. Cookbook Site
      6. Data Bag
      7. Delete
      8. Download
      9. Environment
      10. Node
      11. Recipe List
      12. Role
      13. Search
      14. Show
      15. SSH
      16. Tag
      17. Upload
  17. Chapter 7: Cookbooks
    1. Basics of Cookbooks
    2. Cookbook Directory Structure
      1. Recipes
      2. Resources and Providers
      3. Attributes Files
      4. Definitions
      5. Libraries
      6. Metadata
  18. Chapter 8: Using Cookbooks
    1. MySQL(4.1.2)
      1. Platform
      2. Dependencies
      3. Prerequisite
      4. Cookbook Download
      5. Cookbook Upload
      6. Client Run
    2. Nginx(2.4.2)
      1. Platform
      2. Dependencies
      3. Prerequisite
      4. Cookbook Download
      5. Cookbook Upload
      6. Client Run
    3. Squid(0.4.0)
      1. Platform
      2. Cookbook Download
      3. Cookbook Upload
      4. Client Run
    4. Wordpress(2.1.0)
      1. Platform
      2. Dependencies
      3. Prerequisite
      4. Cookbook Download
      5. Cookbook Upload
      6. Client Run
    5. Tomcat(0.15.0)
      1. Platform
      2. Dependencies
      3. Cookbook Download
      4. Cookbook Upload
      5. Client Run
  19. Chapter 9: Developing a Cookbook
    1. Developing Your First Cookbook
    2. Writing a Recipe
    3. Creating the Index File
    4. Changing the Metadata
    5. Uploading the Cookbook
    6. Running the Cookbook
    7. Add an Attribute
    8. Add a Resource to the Default Recipe
    9. Add the Template File
    10. Uploading and Running the Cookbook
    11. Using Environments
  20. Chapter 10: Lightweight Resource Providers
    1. Lightweight Resource Providers
      1. Chef-Maintained LWRPs
    2. Creating an LWRP
  21. Chapter 11: High Availability
    1. Prerequisite
    2. Setting Up HA
      1. Streaming Replication
      2. Cookbook Replication
    3. Enterprise Chef HA
  22. Chapter 12: Cloud Provisioning Using Chef
    1. Provisioning Using Vagrant and Chef
    2. Providers and Provisioners
    3. Installing Vagrant
      1. Install Virtual Box
      2. Install Vagrant on Windows
      3. Verifying Vagrant Installation
    4. Configuring Vagrant
      1. Vagrant Boxes (OS Images)
      2. Two Methods to Download Vagrant Box
      3. Vagrantfile
      4. Provisioning a New Instance
      5. Connecting to a Virtual Machine
      6. Suspending the Virtual Machine
      7. Halting the Virtual Machine
      8. Destroying the Virtual Machine
      9. Installing Vagrant Plug-Ins
    5. Vagrant Provisioning Using Chef
      1. Chef Solo Provisioner
      2. Options
      3. Specifying a Run List
      4. Specifying Roles
      5. Using Data Bags
      6. Specifying Node Name
      7. Custom JSON Data
      8. Provisioning Chef Client
      9. Adding Run List
      10. Deleting the Node Details
      11. Verifying Chef Client Registration with Chef Server
    6. AWS and Chef Provisioning Using Vagrant
      1. Installing the Plug-ins
      2. Adding the AWS Box to Vagrant
      3. Vagrantfile for AWS Provisioner
    7. Provisioning Using Knife
      1. Knife EC2 Plug-ins
      2. Knife Azure Plug-ins
  23. Chapter 13: Troubleshooting and Debugging
    1. Chef Troubleshooting and Debugging
    2. Debugging Chef Client Run
      1. Running Chef Client with an Empty Run List
      2. Running Chef Client in Debug Mode
      3. Using Chef Client Log Files
      4. Types of Log Errors
      5. Using Chef Handler Cookbook
    3. Debugging Recipes Using Logs
      1. Common Errors
      2. Using a Log Resource
    4. Debugging Recipes Using Chef Shell
      1. Configuring Chef Shell
      2. Debugging Recipes Using Breakpoint Resource
    5. Troubleshooting Chef Client
      1. Chef Client Fails to Run a Recipe Successfully at Bootstrapping
      2. Reregistering a Removed Client
      3. Issues Registering Chef Client with the Server
    6. 401 Unauthorized Errors
      1. Clock Synchronization Error
      2. No Such File or Directory: /etc/chef/validation.pem
      3. Cannot Find Config File
  24. Index