Chef Cheatsheet

Download all cookbooks

$ cd ~/chef-repo

$ knife download cookbooks

Download all roles

$ cd ~/chef-repo

$ knife download roles

Download Specific Cookbook

$ knife download cookbooks/cert-QValent\*  --cookbook-version 0.1.0

Creating cookbook

$ cd ~/chef-repo

$ knife cookbook create newrelic-config     /OR/     cd cookbooks; chef generate cookbook newrelic-config

$ cd cookbooks/newrelic-config/recipes

$ touch update_config.rb

 $notepad update_config.rb

[...Author Recipe.....]

Upload cookbook

$ cd ~\chef-repo

$ ruby -c .\cookbooks\cert-QValent\recipes\qvalent-bit.rb

$ foodcritic .\cookbooks\trendMicro\recipes\*

$ knife cookbook test newrelic-config

$ knife cookbook upload newrelic-config

Modify role and include new recipe

$ vim  .\roles\portalapps.json

  >> "recipe[newrelic-config::update_config]"

Upload Role

$ knife upload .\roles\portalapps.json

Assign Role to Nodes

$ knife node list

$ knife node edit sit9-portalapps-ip-0a9a1670

Download cookbook from supermarket

$ knife cookbook site download