VMware Explore happening NOW!

Learning Chef

Having spent the last few days in Chef training, I needed to get a few notes out here.

Concepts

  • Framework to solve business problems
  • Infrastructure as code
    • programmatically describe and manage infrastructure
    • version controlled infrastructure
    • simplified rebuilds
  • Say what to change/configure, not how.

Relationships

This diagram is taken from the Opscode wiki and explains how the various parts of Chef fit together:

image

Recipes and Cookbooks

imageA lot of time after getting the concepts down, was spent typing. Most of that typing, was building recipes and cookbooks to do various things, the hard way. That is, instead of using knife or another tool to create nodes, recipes, cookbooks, etc, we built the files by hand.

Recipes, are the basic “unit” of a thing in Chef. From the OpsCode wiki:

Recipes are the fundamental configuration in Chef. Recipes encapsulate collections of resources which are executed in the order defined to configure the system.

Recipes are an internal Ruby domain-specific language (DSL), but you do not need to have experience with Ruby to write recipes.

Most things in Chef recipes will be resources to configure. Some things in recipes will be Ruby syntax and helper code.

Cookbooks, are collections of recipes, files, templates, and other resources.

Resources (for learning more Chef)

Again, these were some notes I needed to get written down. Some things that might be more useful to you:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.