Skip to content

Instantly share code, notes, and snippets.

@jmahowald
Created November 26, 2013 07:21
Show Gist options
  • Save jmahowald/7654558 to your computer and use it in GitHub Desktop.
Save jmahowald/7654558 to your computer and use it in GitHub Desktop.
Chef shell script in vagrant to debug chef-solo-search problems
Chef::Config[:cookbook_path] = "/tmp/vagrant-chef-1/chef-solo-1/cookbooks/"
run_list = "recipe[chef-solo-search]"
cl = Chef::CookbookLoader.new(Chef::Config[:cookbook_path])
cl.load_cookbooks
cookbook_collection = Chef::CookbookCollection.new(cl)
@events = Chef::EventDispatch::Dispatcher.new()
node.run_context = Chef::RunContext.new(node, cookbook_collection, @events)
node.run_list = Chef::RunList.new(run_list)
node.run_context.load(node.expand!)
dbags = search(:my_databags,"*:*")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment