Skip to content

Instantly share code, notes, and snippets.

@stevendanna
Created January 10, 2012 06:43
Show Gist options
  • Save stevendanna/1587478 to your computer and use it in GitHub Desktop.
Save stevendanna/1587478 to your computer and use it in GitHub Desktop.
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