diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-08-25 16:08:38 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-08-26 15:49:51 -0700 |
commit | e9265e37c18fccc452273c705521640df5124cf8 (patch) | |
tree | 805acd49a30559adeb8980549fd4c48406916936 /lib/chef/knife/bootstrap.rb | |
parent | 3812f7cb6b267014c4057cd6787b7fc2011ef816 (diff) | |
download | chef-e9265e37c18fccc452273c705521640df5124cf8.tar.gz |
Use existing Chef::Config values for verify_api_cert and ssl_verify_mode during bootstrap.
Diffstat (limited to 'lib/chef/knife/bootstrap.rb')
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 3c934431ec..36a0fc1e47 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -188,20 +188,18 @@ class Chef :description => "Add options to curl when install chef-client", :proc => Proc.new { |co| Chef::Config[:knife][:bootstrap_curl_options] = co } - option :ssl_verify_mode, - :long => "--ssl-verify-mode [none|all]", + option :node_ssl_verify_mode, + :long => "--node-ssl-verify-mode [peer|none]", :description => "Whether or not to verify the SSL cert for all HTTPS requests.", - :proc => Proc.new { |verify_mode| - if verify_mode == "all" - mode = :verify_peer - elsif verify_mode == "none" - mode = :verify_none + :proc => Proc.new { |v| + valid_values = ["none", "peer"] + unless valid_values.include?(v) + raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}" end - Chef::Config[:knife][:ssl_verify_mode] = mode } - option :verify_api_cert, - :long => "--[no-]verify-api-cert", + option :node_verify_api_cert, + :long => "--[no-]node-verify-api-cert", :description => "Verify the SSL cert for HTTPS requests to the Chef server API.", :boolean => true |