Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


razor (4) Versions 0.2.2

Project Razor

cookbook 'razor', '= 0.2.2', :supermarket
cookbook 'razor', '= 0.2.2'
knife supermarket install razor
knife supermarket download razor
Quality -%

<a name="title"></a> Razor Chef Cookbook

Build Status

<a name="description"></a> Description

Chef cookbook to install and manage Razor, a power control,
provisioning, and management application designed to deploy both bare-metal
and virtual computer resources. An LWRP is provided to manage OS and
micro kernel images.

<a name="usage"></a> Usage

Include recipe[razor] in your run_list to install the Razor service and its
dependencies. If you wish to modify or alter the details of the installation
(i.e. using a different mongodb cookbook, installing nodejs from source, etc.),
then compose a custom run_list of the child recipes described

<a name="requirements"></a> Requirements

<a name="requirements-chef"></a> Chef

Tested on 10.14.4 but newer and older version should work just fine. File an
issue if this isn't the case.

<a name="requirements-platform"></a> Platform

The following platforms have been tested with this cookbook, meaning that the
recipes run on these platforms without error:

  • ubuntu (10.04/12.04)

<a name="requirements-cookbooks"></a> Cookbooks

This cookbook depends on the following external cookbooks:

<a name="installation"></a> Installation

Depending on the situation and use case there are several ways to install
this cookbook. All the methods listed below assume a tagged version release
is the target, but omit the tags to get the head of development. A valid
Chef repository structure like the Opscode repo is also assumed.

<a name="installation-community"></a> From the Opscode Community Site

To install this cookbook from the Opscode Community Site, use the knife

knife cookbook site install razor

<a name="installation-berkshelf"></a> Using Berkshelf

Berkshelf is a cookbook dependency manager and development
workflow assistant. To install Berkshelf:

cd chef-repo
gem install berkshelf
berks init

To use the Opscode Community Site version:

echo "cookbook 'razor'" >> Berksfile
berks install

Or to reference the GitHub version:

latest_release=$(curl -s$repo/git/refs/tags \
| ruby -rjson -e '
  j = JSON.parse(;
  puts { |t| t["ref"].split("/").last }.sort.last
cat >> Berksfile < 'git://$repo.git', :branch => '$latest_release'
berks install

<a name="installation-librarian"></a> Using Librarian-Chef

Librarian-Chef is a bundler for your Chef cookbooks.
To install Librarian-Chef:

cd chef-repo
gem install librarian
librarian-chef init

To use the Opscode Community Site version:

echo "cookbook 'razor'" >> Cheffile
librarian-chef install

Or to reference the GitHub version:

latest_release=$(curl -s$repo/git/refs/tags \
| ruby -rjson -e '
  j = JSON.parse(;
  puts { |t| t["ref"].split("/").last }.sort.last
cat >> Cheffile < 'git://$repo.git', :ref => '$latest_release'
librarian-chef install

<a name="recipes"></a> Recipes

<a name="recipes-default"></a> default

Installs the full Razor stack with all dependencies.

Most users will want to use this recipe.

<a name="recipes-tftp"></a> _tftp

Installs a tftp server. This recipe is included in the
default recipe.

<a name="recipes-tftp-files"></a> _tftp_files

Installs files and configuration needed for PXE booting and Razor
bootstraping. This recipe is included in the default

<a name="recipes-mongodb"></a> _mongodb

Installs a MongoDB server (from packages). This recipe is included in the
default recipe.

<a name="recipes-postgresql"></a> _postgresql

Installs the PostgreSQL client libraries. This recipe is included in the
default recipe.

<a name="recipes-nodejs"></a> _nodejs

Installs Node.js and npm (from packages). This recipe is included in the
default recipe.

<a name="recipes-ruby-from-package"></a> _ruby_from_package

Installs Ruby (from system packages) and the Bundler gem. This recipe is
included in the default recipe.

<a name="recipes-rubygems-from-source"></a> _rubygems_from_source

Installs Rubygems from source on older Debian/Ubuntu platforms that ship a
crippled Rubygems package. This recipe is included in the
ruby_from_package recipe and will only be used
on Ubuntu 10.04 nodes.

<a name="recipes-app"></a> _app

Installs and configures the Razor codebase and service. This recipe is
included in the default recipe.

<a name="recipes-add-images"></a> _add_images

Installs images in the Razor service (driven off the images attribute). This
recipe is included in the default recipe.

<a name="attributes"></a> Attributes

<a name="attributes-bind-address"></a> bind_address

IP address to which the Razor web services are bound.

The default is set to node['ipaddress'].

<a name="attributes-mongodb-address"></a> mongodb_address

IP address which has a running MongoDB service.

The default is "".

<a name="attributes-checkin-interval"></a> checkin_interval

The micro kernel checkin interval in seconds.

The default is 60.

<a name="attributes-images"></a> images

A Hash of Razor images to be added. The hash key will correspond to the image
name attribute and the value will be a hash of other attributes to be fed
to the razor_image LWRP. For example:

node['razor']['images'] = {
  'razor-mk' => {
    'type'    => 'mk',
    'url'     => '',
    'action'  => 'add'
  'precise64' => {
    'url'       => '',
    'checksum'  => 'abcabc...',
    'version'   => '12.04'

The default is an empty hash:

<a name="attributes-ruby-system-packages"></a> ruby_system_packages

An Array of system packages which will install the Ruby runtime. The
defaults are set automatically based on platform and platform_version but
can be overridden in needed.

<a name="attributes-npm-packages"></a> npm_packages

An Array of npm packages to be installed. The defaults are set automatically
but can be overridden in needed.

<a name="attributes-install-path"></a> install_path

The install base path of the Razor codebase.

The default is "/opt/razor".

<a name="attributes-bundle-cmd"></a> bundle_cmd

The bundle command which will be used to install Ruby gems.

The default is "bundle" (using $PATH lookup).

<a name="attributes-npm-cmd"></a> npm_cmd

The npm command which will be used to install npm packages.

The default is "npm" (using $PATH lookup).

<a name="attributes-app-git-url"></a> app/git_url

The Git URL for the Razor codebase.

The default is "".

<a name="attributes-app-git-rev"></a> app/git_rev

The Git reference/branch to check out.

The default is "master". Valid values could be Git SHA hashes, branch names,
and "master" for tracking development.

<a name="attributes-rubygems-source-version"></a> rubygems_source/version

The version of Rubygems to be compiled (when necessary).

The default is "1.8.24".

<a name="attributes-rubygems-source-url"></a> rubygems_source/url

The URL containing Rubygems source which will be compiled (when necessary).

The default is set based on the Rubygems version attribute above.

<a name="lwrps"></a> Resources and Providers

<a name="lwrps-image"></a> razor_image

<a name="lwrps-image-actions"></a> Actions

<td>Add the microkernel or operating system image to razor.</td>

<a name="lwrps-image-attributes"></a> Attributes

<th>Default Value</th>
<b>Name attribute:</b> The logical name to use for the image.
The type of image. Valid values are <code>"mk"</code> for micro kernel
images and <code>"os"</code> for operating system images.
HTTP URL containing the image ISO.
The version to use for <code>"os"</code> images only.
An optional SHA-256 checksum for the ISO (for added verification).

<a name="lwrps-image-examples"></a> Examples

Adding A Micro Kernel Image
razor_image "rz_mk_prod-image." do
  type      "mk"
  url       ""
  checksum  "aljdflkjflajkf..."
  action    :add

razor_image "rz_mk_prod-image." do
  type  "mk"
  url   ""

Note: the add action is default, so the second example is a more common

Adding An Operating System Image
razor_image "precise64" do
  type      "os"
  url       ""
  checksum  "lkjdfoidadba..."
  version   "12.04"

razor_image "sl64-6.3" do
  url     ""
  version 6.3

Note: the default for type is "os" so this can be omitted in most cases.
The version attribute can also be a Float.

<a name="development"></a> Development

Pull requests are very welcome! Make sure your patches are well tested.
Ideally create a topic branch for every separate change you make.

<a name="license"></a> License and Author

Author:: Fletcher Nichol (

Copyright 2012, Blue Box Group, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

build-essential >= 0.0.0
git >= 0.0.0
tftp >= 0.0.0
mongodb >= 0.0.0
postgresql >= 0.0.0
nodejs >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found