Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Created June 25, 2012 19:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtimberman/2990600 to your computer and use it in GitHub Desktop.
Save jtimberman/2990600 to your computer and use it in GitHub Desktop.
Work with the Chef Server API in the "main" context of "Shef" (Chef Console)
require 'chef/shef/ext'
Shef::Extensions.extend_context_object(self)
Chef::Config.from_file("/etc/chef/knife.rb")
search(:node, "role:base") # => [node[i-9c8168e5]]
@jtimberman
Copy link
Author

Further information on the Chef wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment