How to bootstrap Chef Solo on Linode

I've been doing a lot of work with Chef Solo lately and Linode is my preferred VPS provider, so I needed a way to bootstrap Chef Solo easily onto new nodes.

Linode's uses "StackScripts" for customizing nodes -- these are run-once scripts that do any configuration on top of a stock OS distribution.

There were already a few Chef-related stack scripts, but the most-promising ones all set up RVM and installed Chef from gems, which seemed overly complicated. I decided to write my own, since it only takes about 20 lines:

#!/bin/sh

# Don't prompt during installs
export DEBIAN_FRONTEND=noninteractive

# Enable Opscode repository
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main"; | tee /etc/apt/sources.list.d/opscode.list

# Upgrade the system
apt-get update
apt-get upgrade -y

# Install Opscode key and update database again
apt-get install --allow-unauthenticated -y opscode-keyring 
apt-get update

# Install chef
apt-get install -y chef

# We don't need Chef Client for Chef Solo, so shut it off
/etc/init.d/chef-client stop
update-rc.d -f chef-client remove

If you use Linode, it's StackScript 5537: Minimal Chef Solo

It's Ubuntu-specific, since that's what I'm using, but you're welcome to adapt it for your own OS.

Happy cooking!

This entry was posted in chef and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.

2 Comments

  1. Alex
    Posted October 15, 2012 at 1:56 am | Permalink

    Thanks for this! Exactly what I was looking for.

    • Posted October 15, 2012 at 6:54 am | Permalink

      You're welcome! Glad it helps!

© 2009-2014 David Golden All Rights Reserved