Sprinkle: the provisioning tool for people who don't have huge server clusters

Posted by Luke Francl
on Thursday, June 04

I’ve recently been trying to find a good server automation tool that meets my needs. I looked at Chef and Puppet.

They are both awesome for what they do, but what I don’t like is all the infrastructure I have to maintain to run Chef or Puppet. You need a server to host your server configuration on. But I only have one server![1] Chef does have a solo version which can download configuration from a web server and run it. That’s cool, but I don’t want to have a web server just for putting server configuration on.

When the time commitment to set up one of these tools up greatly exceeds how long it is for me to bring up a new slice and run through the standard Apache/DB/Passenger stack, I lose interest. In the end, these are great tools for managing a cluster of machines and bringing up a new app in the cluster quickly—and keeping it up to date automatically. If you have big infrastructure needs, they make sense. If you just want to set up a single slice…ugh.

After reading a bit about how Puppet and Chef work, what I really wanted was the ability to push server provisioning recipes. I want to maintain the server config in my repository and then provision a new server with a command I run on my machine. Sort of like deprec, but understandable.

Fortunately, I found Sprinkle and passenger-stack.

Sprinkle lets me quickly define which packages I want installed and push it out to a server to run (via Capistrano, Vlad, or Net::SSH). Sprinkle makes it easy to install software using apt, gem, or source. And unlike a simple shell script, Sprinkle tests whether or not the software is installed before running, and has a concept of dependencies.

Passenger-stack removes the pain of writing my own rules for what to install. It comes with the standard stuff you’d need, and you can customize it from there.

Here’s how you install all the software you need for a fresh server, after downloading passenger-stack:

sprinkle -c -s config/install.rb

The best part is that you can run that command again, and it won’t do anything. So you can add new software to your stack, then run it against your server, and only the new software will get installed.

This gives you a great way to manage natively compiled gems and ensure that if you ever need to spin up a staging server or a demo server, everything you need gets installed.

Check out this screencast by Ben Schwartz, author of passenger-stack.

Passenger-stack demo from Ben Schwarz on Vimeo.

It’s not a smart as Chef and Puppet. It’s not transactional and servers don’t check for new software to install automatically. But it sure is easy. That’s why I call Sprinkle “the provisioning tool for people who don’t have huge server clusters.”

1 Basically. I have many servers with many different applications on them. And I have a few servers that have multiple environments, but the same software. That’s my big driver for wanting a provisioning tool.

Comments

Leave a response

  1. Jon DahlJune 04, 2009 @ 12:23 PM

    “Sprinkle: the provisioning tool for people who don’t have huge server clusters” is a better tagline than “Chef/Puppet: 10 hours of setup for every 1 hour of time savings.” :)

    (Disclaimer: I don’t have huge server clusters, and I’m sure Chef/Puppet are great for those.)

  2. Jesse NewlandJune 04, 2009 @ 12:38 PM

    Great article, I share your sentiments about Chef/Puppet not being very well suited for small Rails deployments. That’s actually what inspired Moonshine – it’s a simple DSL for writing Rails-centric configuration manifests that are executed during a Capistrano deployment. It uses the Puppet engine internally, but doesn’t require a puppetmaster or manifests written in Puppet’s bizarre configuration language – Moonshine manifests are just Ruby classes. What’s especially cool is that Moonshine manifests can subclass other manifests and inherit their behavior – very useful if you have some common requirements shared among a group of apps. There’s even a plugin system for packaging up commonly used deployment components.

    The default Moonshine stack is very similar to passenger stack – in fact, given a Ubuntu 8.0x > server with a sudo user, deploying many rails apps with moonshine is as simple as cap deploy:setup && cap deploy. If you have some time, give it a quick look and let me know what you think!

  3. Luke FranclJune 04, 2009 @ 01:12 PM

    Hey Jesse, thanks for stopping by.

    I did a quick drive-by pass at Moonshine but I didn’t look into it too much because I’d already found passenger-stack and it did pretty much what I wanted. Moonshine looks cool, though.

    I didn’t write about this in the article but the other barrier to using a provisioning tools is having to write up all the recipes. I’m not a sysadmin so I don’t know exactly how to install all this stuff. If I was going to do it, I’d have to set up the server and write it all down and translate it to the provisioning tool’s format. But by that time I’d have a fully configured server and laziness would probably take hold!

    So having pre-configured recipes is essential! Moonshine, deprec and passenger-stack give you this (but I’ve never liked how deprec sets up my servers.).