Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Chef: Quick and Tasty Ruby Powered Server Configuration

By Ric Roberts / August 5, 2009

chefChef isn't exactly new, but I've been looking into it recently after briefly talking to Lindsay Holmwood at Rails Underground.

Basically, Chef is a Ruby-based configuration management engine. You set up recipes for how you want your system configured, and then Chef will cook it up for you.  So, you can write lovely Ruby code to manage your servers, rather than running commands directly on your server.

With Chef, one of your systems is the server and all others are clients that communicate with the Chef "server" via REST over HTTPS. The server is a Merb application that stores cookbooks for your nodes using CouchDB.

The work is done by the clients, running the recipes for one or many nodes thus configuring that particular machine. The Chef server is only there to provide information to the clients.  Once configured, you can access your Chef server and its cookbooks via a Web interface.  You can create your own cookbooks from scratch but it's worth checking to see if one already exists in the Chef repository or one of its forks.

Once you've got your recipes sorted out, Chef allows you to programatically set up and commission production-ready server instances in next to no time.

Ezra's Cooking with Chef 101 blog post is a great place to get started, and there's a wealth of information in the Opscode Chef wiki. The Superfeedr blog post, Scale With Chef, is also worth a read.

jslab.pngAlso.. Jumpstart Lab is running Rails Jumpstart - an intro to Rails - on August 15&16 then JavaScript Jumpstart for intermediate Javascript & UI programmers on 9/12. All courses are in Washington, DC. Save 10% with code "rubyinside"!

Comments

  1. Stephen Stillwater says:

    Chef is cool - but it's a pain in the butt to get set up on CentOS. Still pretty Ubuntu-centric, I believe.

    I'd love to be proven wrong, mind you!

  2. Michael D'Auria says:

    I would have to agree with Stephen on this one. We ended up going with Puppet, which seems to be more flexible and supports CentOS out of the box.

    I would also love to be proven wrong.

  3. Peter Cooper says:

    If anyone wants to do a hardcore Chef vs Puppet type post either here or on their own blog, I'm game (to link or to post). I'm pretty ignorant of this area, personally, though I think Ric did a reasonable job of summing up Chef on its own.

  4. Stephen Stillwater says:

    @Peter: hype aside, I think the excitement around Chef is pretty well justified. Chef solves a slew of problems, and since it lets you drop in to "full on Ruby", it feels more flexible than Chef.

    But...I guess Opscode is still "on the runway" in terms of getting started, so CentOS support is not at the top of the priority list, which is fine. On the Opscode wiki, there's a lot of folks working hard to get Chef up and running on CentOS, but it's still pretty tricky (at least last we tried).

  5. Matthijs Langenberg says:

    It's using CouchDB? Really? I can't believe that's really necessary, but maybe I'm missing some point.

Other Posts to Enjoy

Twitter Mentions