Babushka: test-driven sysadmin.

Installing babushka

Babushka is best installed using babushka.me/up, a script that installs babushka via git (and some dependencies via your system’s package manager). It’s safe to run on existing systems; if you’re running git and ruby already then all that’s installed is babushka itself.

The script is also designed to be used as the initial shell command on a brand new laptop or server. Its only prerequisite, which most systems ship with, is something that can fetch over https. Mac OS X and some Linux distros ship with curl:

sh -c "`curl https://babushka.me/up`"

If your system doesn’t ship with curl, you can install it first. Here are some examples:

# on Arch Linux
pacman -S curl && sh -c "`curl https://babushka.me/up`"

# on Ubuntu Linux
apt-get install -y curl && sh -c "`curl https://babushka.me/up`"

Some other Linux distros ship with wget instead. Many of these stock wget installs lack openssl, which means no https downloads. You could install curl first (which should pull in openssl; see above), or just cowboy it over http with wget:

sh -c "`wget -O - babushka.me/up`" # Hijack me, please!

What it does

The script is fairly straightforward. Here’s what it does:

Here’s the script and the template that it’s rendered from if you’d like to review them.

Installing babushka doesn’t make any surprising changes to your system. You can completely uninstall it by deleting it:

rm -rf /usr/local/babushka /usr/local/bin/babushka

Scripting the install

The bootstrap script prompts for confirmation and an install prefix. If you’re scripting the install, fear not: it runs unconditionally, accepting the defaults for those prompts, if STDIN isn’t attached to a terminal. If you’d like to run a prompt-less install at the terminal, just attach STDIN to /dev/null instead:

sh -c "`curl https://babushka.me/up`" </dev/null

Versions

By default, babushka.me/up will install the latest stable version, but this can be customised. Just set the VERSION env var to a git ref like so (the default is stable):

VERSION=<ref> sh -c "`curl https://babushka.me/up`"

You can supply any ref that github serves as a tarball: any branch, tag, or SHA will work. Some examples:

If you like, you can lock your install by supplying a SHA, which can never change:

VERSION=4ff73e0eda5ff439fd786e4a3bea8568abc95fe2 sh -c "`curl https://babushka.me/up`"

You could also use a tag, for readability (version tags will never be mutated on this repo):

VERSION=v0.16.10 sh -c "`curl https://babushka.me/up`"

Installing a custom babushka

By default, babushka is installed from my repo on github, benhoskings/babushka. If you like, you can install from your own repo instead by passing a custom repo URI in the $BABUSHKA_REPO environment variable, like so:

BABUSHKA_REPO=https://github.com/dgoodlad/babushka.git \
VERSION=master \
  sh -c "`curl https://babushka.me/up`"

This is useful for running installs in situations where github isn’t accessible, or if you’d like to install from a fork of babushka.

Manual installation

If you’d prefer to install manually, it’s pretty straightforward. First, ensure ruby and git are installed to your taste:

pacman -S ruby git # Adjust for your system as required

Grab a local copy of babushka from the githubs:

git clone https://github.com/benhoskings/babushka.git ./babushka
cd babushka

Then you can run babushka with ./bin/babushka.rb, or if you like, symlink it into your PATH:

cd /usr/local/bin
ln -s /path/to/babushka/bin/babushka.rb ./babushka

My kingdom for a gem

Even though babushka is a ruby app, there’s no gem distribution. The reason for this is that setting up a particular ruby build, rubygems, and maybe rbenv or chruby along the way is just the kind of thing babushka is good at. So in the interests of consistency, I recommend installing babushka via git repo every time, whether or not you use babushka.me/up to do it.