Skip to content

Instantly share code, notes, and snippets.

@tily
Created April 30, 2012 06:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tily/2555908 to your computer and use it in GitHub Desktop.
Save tily/2555908 to your computer and use it in GitHub Desktop.
自分のアプリケーションから Chef Solo を呼び出す
# Usage: ruby chef_solo_in_your_application.rb
require 'rubygems'
require 'chef'
Chef::Config[:solo] = true
Chef::Config[:file_cache_path] = '/path/to/chef-repo'
Chef::Config[:cookbook_path] = ['/path/to/chef-repo/cookbooks']
@chef_solo = Chef::Client.new(JSON.load File.read ARGV.first)
@chef_solo.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment