lib/chef/knife/bootstrap.rb in chef-10.12.0 vs lib/chef/knife/bootstrap.rb in chef-10.14.0.beta.1

- old
+ new

@@ -28,10 +28,11 @@ require 'chef/json_compat' require 'tempfile' require 'highline' require 'net/ssh' require 'net/ssh/multi' + require 'chef/knife/ssh' Chef::Knife::Ssh.load_deps end banner "knife bootstrap FQDN (options)" @@ -103,11 +104,11 @@ :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 => [] - + option :first_boot_attributes, :short => "-j JSON_ATTRIBS", :long => "--json-attributes", :description => "A JSON string to be added to the first run of chef-client", :proc => lambda { |o| JSON.parse(o) }, @@ -116,9 +117,17 @@ option :host_key_verify, :long => "--[no-]host-key-verify", :description => "Verify host key, enabled by default.", :boolean => true, :default => true + + Chef::Config[:knife][:hints] ||= Hash.new + option :hint, + :long => "--hint HINT_NAME[=HINT_FILE]", + :description => "Specify Ohai Hint to be set on the bootstrap target. Use multiple --hint options to specify multiple hints.", + :proc => Proc.new { |h| + name, path = h.split("=") + Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new } def load_template(template=nil) # Are we bootstrapping using an already shipped template? if config[:template_file] bootstrap_files = config[:template_file]