Created
January 10, 2012 06:43
-
-
Save stevendanna/1587478 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/knife' | |
class Chef | |
class Knife | |
class CheckBootstrap < Knife | |
deps do | |
require 'chef/knife/bootstrap' | |
require 'chef/knife/core/bootstrap_context' | |
require 'erubis' | |
end | |
option :use_sudo, | |
:long => "--sudo", | |
:description => "Execute the bootstrap via sudo", | |
:boolean => true | |
option :run_list, | |
:short => "-r RUN_LIST", | |
:long => "--run-list RUN_LIST", | |
:description => "Comma separated list of roles/recipes to apply", | |
:proc => lambda { |o| o.split(/[\s,]+/) }, | |
:default => [] | |
banner "knife check bootstrap TEMPLATE_NAME" | |
def run | |
b = Chef::Knife::Bootstrap.new | |
b.config = config | |
b.config[:distro] = @name_args[0] | |
puts b.ssh_command | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment