BuckKnife

Not a Knife

BuckKnife adds a knife project subcommand to Chef's knife.

Caveats

BuckKnife is undergoing active development. A 1.0 version will be released when we think the project is in a stable state. Until then, this is alpha quality.

Configuration

Add these configurations to your .chef/knife.rb:

knife[:project_dir] = "path/to/chef-rep/data_bags/projects"
knife[:buckknife_namespace] = "buckknife" # This is a default, you probably don't need to change this

Here is a complete ~/.chef/knife.rb example:

chef_repo_dir = "~/Chef"

log_level                :info
log_location             STDOUT
interval                 300
client_key               "~/.chef/clientkey.pem"
validation_client_name   "chef-validator"
validation_key           "#{chef_repo_dir}/.chef/validation.pem"
chef_server_url          "http://chefserver.example.com"
cache_type               "BasicFile"
cache_options( :path => "#{chef_repo_dir}/.chef/checksums" )
cookbook_path            "#{chef_repo_dir}/cookbooks"
knife[:project_dir] = "#{chef_repo_dir}/data_bags/projects"

Getting Started

This is the current process to create chef server clusters based on a project .json file. There are many improvements that need to be made to make this more automated.

  1. Edit your ~/.chef/knife.rb to include your project dir
  2. Create a project data bag:

    knife project new myapp

  3. Generate create commands

    knife project create myapp

  4. Generate add role commands

    knife project add role myapp

  5. Generate run client commands

    knife project run client myapp

TODO

  • Move database passwords out of project.json
  • Move ssh user/pass out of capistrano template