You should be doing automated configuration, period. Chef is a great automated configuration tool.
It has to be said, however, that chef has lots of parts, arguably an excess. If you google around for chef intros you see chef-solo referenced as a simple first step into “full” or “real” chef – chef client/server.
On our project we’ve built a mature web application, we’ve been using chef for over a year, and have never once felt the need for the client/server model, and we have no reason to expect to.
Here’s how we run chef manually:
cd ~/projectroot
git pull
chef/run.sh
(that’s it)
run.sh contains:
sudo sh -c "RAILS_ENV=$RAILS_ENV chef-solo -c chef/config/solo.rb -j chef/config/$RAILS_ENV/`hostname -s`.json"
We have capistrano (multi-server ssh tool) do the equivalent on deploy:
sudo [
"cd #{app_root}",
"export RAILS_ENV=#{self.variables[:rails_env]}",
"chef/run.sh"
].join(" && ")
We deploy our code and update system config at the same time.
And that’s all we need or want.
Links:
- Cooking with Chef 101 – a chef-solo-centric chef introduction
- Chef wiki
About the Author