Chef

Mature Open Source configuration management tool developed by Opscode written in Ruby and Erlang.

Chef Architecture

Chef Workstaton

  • The Chef Workstations is the System Administrators PC
  • He writes Recipes in Ruby that are compiled into a Cookbook
  • A Cookbook is a collection of Recipes and defines how are Nodes are set up (A bunch of servers)
  • Knife is the CLI tool used to sends the Cookbook to the Chef Server

Chef Server

  • The Chef Server stores Cookbooks and can be hosted on localhost or remotely
  • The Server also provides tools to drive node configurations

Chef Node

  • These are the systems to be configured
  • The OHAI service fetches the current state of the Nodes and sends it to the Chef Client
  • The Chef Client communicates with the Chef Server

Chef Flavours

  • Chef Client/Server: Traditional Chef Architecture
  • Chef Solo: Cookbooks are located at the Local Site
  • Hosted Chef: The Server is a Service in the Cloud
  • Private Chef: Enterprise Version of Chef

Pros

  • Mature Solution for heterogenous environments
  • Lots of recipes available

Cons

  • Requires learning Ruby
  • Master doesn’t have much control, the entire network communicates

Chef Commands

chef generate cookbook sample
knife cookbook upload sample
# connect server and node
knife bootstrap NODE_IP --ssh-user root --ssh-password SSH_PWD --node-name chef_node