Skip to content

Instantly share code, notes, and snippets.

@jessehu
Created Feb 21, 2013
Embed
What would you like to do?
a ruby script for calling Ironfan's cluster class.
#!/usr/bin/env ruby
require 'chef'
require 'chef/knife'
require 'ironfan'
require 'chef/knife/cluster_bootstrap.rb'
knife = Chef::Knife::ClusterBootstrap.new
knife.class.load_deps
knife.class.chef_config_dir
knife.config[:config_file] = '/path/to/.chef/knife.rb'
knife.configure_chef
Chef::Config[:distro] = 'centos5'
options = '--yes'.split
knife.parse_options(options)
knife.name_args = [ 'cluster[-facet[-index]]' ]
knife.config[:verbosity] = 2
Chef::Log.level = :warn
knife.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment