Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Learning Chef
Table of Contents
Learning Chef
Credits
About the Authors
About the Reviewers
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
Downloading the example code
Errata
Piracy
1. An Overview of Automation and Advent of Chef
Automation
Why automation is needed
Introduction to Chef
Why Chef is a preferred tool
The salient features of Chef
Automation with Chef
Existing automation tools and comparison with Chef
InstallShield
Features of InstallShield
AutoIt
Features of AutoIt
Windows PowerShell scripting
Features of PowerShell
CFEngine
Features of CFEngine
Puppet
Bcfg2
Cobbler
Sprinkle
cdist
Pallet
Rex
Glu
RunDeck
Crowbar
Fabric
Ansible
SaltStack
Mina
Juju
Comparison with other popular tools
Chef versus Puppet
Chef versus CFEngine
Self-test questions
Summary
2. Different Components of Chef's Anatomy
The Chef automation
The Chef framework
Chef components
The Chef server
Different types of Chef servers
Hosted Chef server
Private Chef
Open source Chef-sever
Chef server tools
Different types of Chef server tools
erchef
Nginx
WebUI
Message queues
Search index
PostgreSQL
Bookshelf
Cookbooks
Recipes
Attributes
Versions
Node objects
Run-lists
Attributes
Policies
Roles
Data bags
An environment
Workstations
Workstation tools
Knife
A Chef repository
Authentication procedure between a workstation and Chef server
Nodes
Types of nodes
Physical nodes
Virtual nodes
Cloud instances
Tools of a node
A Chef-client
Ohai
The Chef server API
GitHub
Chef-solo
The Chef community
Databases
Web servers
Process management
Programing languages
Monitoring
Package management
Virtualization and cloud
Chef-run
Integration of Chef with Vagrant
A quick hands-on experience of a Hosted Chef server
Self-test questions
Summary
3. Workstation Setup and Cookbook Creation
The VirtualBox installation
The Vagrant installation
The Git installation
Installation and configuration of a workstation
Workstation setup - creating a Chef repository
Workstation setup using Git on Windows 8
Workstation setup without Git on CentOS
The Ruby installation and required settings
Setting up the Chef repository and downloading cookbooks
Launching a virtual machine with Vagrant and a workstation setup
Creating and uploading a simple cookbook
Uploading cookbooks
Troubleshooting
Error code – type 1
Meaning
Troubleshooting steps
Error code – type 2
Meaning
Troubleshooting steps
Error code – type 3
Meaning
Troubleshooting steps
Error code – type 4
Meaning
Troubleshooting steps
Error code – type 5
Meaning
Troubleshooting steps
Error code – type 6
Meaning
Troubleshooting steps
Error code – type 7
Meaning
Troubleshooting steps
Self-test questions
Summary
4. Learning about Cookbooks
Cookbook types
Application cookbooks
Library cookbooks
Wrapper cookbooks
Components of a cookbook
Attributes
Definitions
Syntax of a definition
Example of a definition
Files
Syntax of a file
Example of a file
Libraries
Syntax of a library
Example of a library
Resources and providers
Syntax of resources
Example of resources
Templates
Syntax of a template
Example of a template
An LWRP
Components of an LWRP
Metadata
The metadata.rb file
The Error message
Self-test questions
Summary
5. Managing the Nodes
Adding and deleting a node
Adding a new node
Deletion of a node
Editing a node
Bootstrapping target nodes
The Knife.bootstrap command
The verification process for a node
Introducing search
Syntax of a search query
Search by different options
Search by node
Search by node and environment
Search for nested attributes
Search for multiple attributes
A partial search
Introducing data bags
Introducing handler
Types of handlers
Installation and configuration of a handler
The manual installation
Using chef_handler
Writing a simple handler
Open source handlers
Self-test questions
Summary
6. Working with an Open Source Chef Server
System requirements
Installing an open source Chef server
FQDN and hostnames configuration
Restarting the virtual machine
Changing the hostname
Installing an open source Chef server on a VMware Fusion virtual machine – Ubuntu 12.04
VM machine settings
Installing an open source Chef server on a VM machine
Installing an open source Chef server on a VMware Workstation virtual machine – CentOS 6.x
Installing an open source Chef server on Amazon Web Services ( AWS )
Setting up the workstation
System requirements
Bootstrapping a node
The Nodes tab
The Clients tab
Using community cookbooks
Upgradation of the open source Chef server
Existing requirements
Accessing the Chef server 0.10.x
Downloading data from the Chef server 0.10.x
Accessing the Chef server 11.x
Updating Chef-validator settings
Verifying the admin public key
Verification of user passwords
Uploading data to the Chef server 11.x
The last steps
Self-test questions
Summary
7. Working with the On-premises Chef Server Setup
The on-premises Chef server
Benefits of on-premises Chef
Simple to scale
Completely automotive solution
Fast and easy configuration management
Reduced complexity within infrastructure
Improved data encryption policies
Types of on-premises Chef installations
Standalone on-premises Chef
Tiered on-premises Chef
High-availability on-premises Chef
Downloading the installation package
Prerequisites for the standalone on-premises Chef installation
Firewall requirements
Installing standalone on-premises Chef
Installing the on-premises Chef package on CentOS and Red Hat
Prerequisites for the tiered on-premises Chef installation
Load balancer requirements
Configuring api_fqdn
Firewall requirements
Ports for frontend servers
Ports for backend servers
Configuring the private-chef.rb file
The required settings for the backend server
The required settings for the frontend server
Adding on-premises Chef packages to servers
Installing tiered on-premises Chef
Configuring Bootstrap and installing on-premises Chef
Configuring the frontend server and installing on-premises Chef
Installing on-premises Chef packages
Prerequisites for the high-availability Chef installation
Load balancer requirements
Configuring api_fqdn
Ports for frontend servers
Ports for backend servers
Configure the private-chef.rb file
The required settings for the backend server with Bootstrapping
The required settings for other backend servers
The required changes for frontend entries
Configuring api_fqdn
Examples
Adding on-premises Chef packages to servers
Installing the high-availability Chef server
Installing on-premises Chef on the backend server
Installing DRBD on the backend servers
The DRBD installation on CentOS and Red Hat
The DRBD installation on Ubuntu
The DRBD configuration on the backend Bootstrap server
The DRBD configuration on the backend non-Bootstrap server
Checking the filesystem for the DRBD server
Configuring on-premises Chef on the Bootstrap backend server
Configuring on-premises Chef on the non-Bootstrap backend server
Configuring and installing on-premises Chef on the frontend servers
Installing on-premises Chef packages
Managing on-premises Chef
Service commands
Viewing Chef commands
Uninstalling on-premises Chef
View configuration
Reconfiguring Chef
Service subcommands
The hup subcommand
The int subcommand
The kill subcommand
The once subcommand
The service-list subcommand
The start subcommand
The restart subcommand
The stop subcommand
The status subcommand
The tail subcommand
The term subcommand
Log files
Self-test questions
Summary
8. Managing Chef on Cloud Infrastructure
What is cloud computing?
Why Chef with cloud infrastructure?
AWS EC2 bootstrapping using Chef
Preparing your workstation
Installing the knife-ec2 plugin
Configuring the AWS settings and the knife.rb file
Configuring knife.rb with your AWS Cloud credentials
Bootstrapping the EC2 instance
Various
The expected output
Running the Chef-client on the new client node (cloud instance)
Verification of the complete installation
Managing recipes on the new client node
Running the Chef-client as a daemon
Rackspace Cloud server bootstrapping
The prerequisite to work with Rackspace Cloud
Installing plugins for knife-rackspace
Preparing the workstation with Rackspace credentials
Bootstrapping the Rackspace Cloud server with the Chef-client
Deleting Rackspace servers
The Knife-cloud plugin
VMware and Chef
Self-test questions
Summary
9. Best Practices while Using Chef
Chef anti-patterns and patterns
A wrapper cookbook
A default cookbook
Testing cookbooks
Types of cookbook tests
Checking the syntax
Integration testing
Checking the result
Checking the consistency
Checking the performance
Best practices for effective usage of Chef
Planning in advance
Designing a cookbook
Using a private recipe
Avoiding the use of one giant cookbook
Avoid overloading of a Chef environment
Self-test questions
Summary
10. Case Studies on Different Chef Deployments
Case studies of Hosted Chef deployments
Admeld
Challenges with the infrastructure of Admeld
The solution with Hosted Chef
The final outcome
Fanhattan
Challenges with the infrastructure of Fanhattan
The solution with Hosted Chef
The final outcome
Zumba Fitness
Challenges with the infrastructure of Zumba Fitness
The solution with Hosted Chef
The final outcome
The Limelight video platform
Challenges with the infrastructure of Limelight
The solution with Hosted Chef
The final outcome
Imagination
Challenges with the infrastructure of Imagination
The solution with Hosted Chef
The final outcome
Getaroom
Challenges with the infrastructure of Getaroom
The solution with Hosted Chef
The final outcome
Case studies of Private Chef deployment
Ancestry.com
Challenges with the infrastructure of Ancestry.com
The solution with Private Chef
The final outcome
Facebook
Challenges with the infrastructure of Facebook
The solution with Private Chef
The final outcome
DreamHost
Challenges with the infrastructure of DreamHost
The solution with Private Chef
The final outcome
Case studies of the open source Chef deployment
SolutionSet
Challenges with the infrastructure of SolutionSet
The solution with open source Chef
The final outcome
Case studies of the Chef-solo deployment
Wharton School - University of Pennsylvania
Challenges with the infrastructure of Wharton School
The solution with Chef-solo
The final outcome
Self-test questions
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →