Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Concepts from spatula and littlechef implemented as a knife plugin
Ruby Shell
Pull request Compare This branch is 2 commits ahead, 853 commits behind matschaffer:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.




Knife-solo is a gem plugin for Chef's knife utility. It currently adds 3 subcommands to knife: kitchen, prepare and cook

The kitchen command is used to create a new directory structure that fits with chef's standard structure and can be used to build and store recipes.

The prepare command installs Ruby, RubyGems and Chef on a given host. It's structured to auto-detect the target OS and change the installation process accordingly.

The cook command uploads the current kitchen (chef repo) to the target host and runs chef-solo on that host.

Preliminary Windows support for cook is available (see below).


Installation is a normal gem installation.

gem install knife-solo

Kitchen command

The kitchen command simply takes a name of the directory to store the kitchen structure.

knife kitchen mychefrepo

Currently the directory structure looks like this, but could change as development continues.

├── cookbooks
├── data_bags
├── nodes
├── roles
├── site-cookbooks
└── solo.rb

Prepare command

The prepare command takes an ssh-style host argument as follows:

knife prepare ubuntu@

It will look up SSH information from ~/.ssh/config or in the file specified by -F. You can also pass port information (-p), identity information (-i), or a password (-P). It will use sudo to run some of these commands and will prompt you for the password if it's not supplied on the command line.

Cook command

The cook command also takes an ssh-style host argument:

knife cook ubuntu@

The cook command uploads the current kitchen to the server and runs chef-solo on that server. If you only specify one argument it will look for a node config in +nodes/<hostname>.json+. Or if you want to specify a node config you can pass the path to the file as the second argument.

This uploads all of your cookbooks in addition to a patch that allows you to use data_bags in a read-only fashion from the data_bags folder.

Windows support

The cook command will work on Windows node if you meet the following howto:

Kitchen then tweak

Prepare the node manually


  • cook should work as expected automatically, if you use cygwin rsync


Get set up by running ./script/newb this will do some of the steps and guide you through the rest. If it doesn't run for you, feel free to file an issue.

When running integration tests you can specify VERBOSE=true as an environment variable to enable verbose output. All integration testing output is sent to the log directory into a file that matches matches the test case name.

You can also specify SKIP_DESTROY=true to leave the EC2 instances running after test completion. Note that this is for debugging purposes and re-running the test will not re-use old instances. Please clean them up manually if you cancel the test or specify SKIP_DESTROY.

To make an integration test, create a file in the test/integration directory and a test class that inherits from IntegrationTest and includes +IntegrationTest::BasicPrepareAndCook+ or other test cases. You can override methods as necessary, but generally you only need to override user and image_id to specify the user name and AMI ID.

If you're interested in contributing, contact me via GitHub or have a look at the GitHub issues page.

Something went wrong with that request. Please try again.