0.0
No commit activity in last 3 years
No release in over 3 years
Sandwich lets you apply Chef recipes to your system without having to worry about cookbooks or configuration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.6.4
~> 5.5.1
~> 10.4.2

Runtime

~> 11.12.8
~> 2.1.5
 Project Readme

sandwich

The easiest way to get started as a chef.

Documentation

Sandwich is the easiest way to get started with Chef, a Ruby-based configuration management tool.

Sandwich lets you apply Chef recipes to your system without having to worry about setting up cookbooks, runlists or any configuration at all. Using Sandwich you can run Chef recipes the way you would run shell scripts: by piping recipes directly to Sandwich or running recipe files locally.

For example, installing the package htop works like this:

echo "package 'htop'" | sudo sandwich

If you wanted to install zsh, make it the default shell for root and add a simple alias (without overwriting the existing zshrc), you could do something like this:

cat <<EOF | sudo sandwich -l info
package "zsh"

user "root" do
  shell "/bin/zsh"
end

file "/root/.zshrc" do
  content "alias ll='ls -l'"
  not_if { File.exist? "/root/.zshrc" }
end
EOF

(Yes, you can just copy & paste this. Go ahead, I'll be waiting.)

Sandwich even makes managing cron jobs easy. Say you want to generate a new signature file ~/.signature.sample every day at 4:02 AM by running fortune and ensure fortune is actually installed, the recipe would look something like this:

cat <<EOF > fortune-signature.rb
package "fortunes-bofh-excuses"
cron "email-signature" do
  hour "4"
  minute "02"
  user ENV['SUDO_USER']
  command "fortune bofh-excuses > ~/.signature.sample"
end
EOF
sudo sandwich -l info fortune-signature.rb

Installation

Sandwich is available as a gem called chef-sandwich:

sudo gem install chef-sandwich

There's also a chef-sandwich package for Debian/Ubuntu. Make sure to install a recent Chef version to go with Sandwich:

sudo apt-get install curl lsb-release python-software-properties
bash < <( curl -sL https://raw.github.com/sometimesfood/chef-admin-essentials/master/contrib/install-chef.sh )
sudo add-apt-repository ppa:sometimesfood/chef-sandwich
sudo apt-get update
sudo apt-get install chef-sandwich

Extras

For a more in depth description of Chef's resources, see Chef Resources.

Note: Sandwiches with a side of rocco help aspiring chefs to share their recipes.

Copyright

Copyright (c) 2011 Sebastian Boehm. See LICENSE for details.