summaryrefslogtreecommitdiff
path: root/lib/chef/knife/bootstrap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/bootstrap.rb')
-rw-r--r--lib/chef/knife/bootstrap.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 13f8731c77..7eb20e6dfb 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -195,6 +195,7 @@ class Chef
unless valid_values.include?(v)
raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}"
end
+
v
}
@@ -647,6 +648,7 @@ class Chef
q.echo = false
end
end
+
opts.merge! force_ssh_password_opts(password)
do_connect(opts)
else
@@ -661,6 +663,7 @@ class Chef
# we'll use the one that you gave in the URL.
def connection_protocol
return @connection_protocol if @connection_protocol
+
from_url = host_descriptor =~ /^(.*):\/\// ? $1 : nil
from_cli = config[:connection_protocol]
from_knife = Chef::Config[:knife][:connection_protocol]
@@ -678,6 +681,7 @@ class Chef
if @config[:first_boot_attributes] && @config[:first_boot_attributes_from_file]
raise Chef::Exceptions::BootstrapCommandInputError
end
+
true
end
@@ -842,6 +846,7 @@ class Chef
# host via train
def connection_opts(reset: false)
return @connection_opts unless @connection_opts.nil? || reset == true
+
@connection_opts = {}
@connection_opts.merge! base_opts
@connection_opts.merge! host_verify_opts
@@ -892,6 +897,7 @@ class Chef
def ssh_opts
opts = {}
return opts if winrm?
+
opts[:pty] = true # ensure we can talk to systems with requiretty set true in sshd config
opts[:non_interactive] = true # Prevent password prompts from underlying net/ssh
opts[:forward_agent] = (config_value(:ssh_forward_agent) === true)
@@ -902,6 +908,7 @@ class Chef
def ssh_identity_opts
opts = {}
return opts if winrm?
+
identity_file = config_value(:ssh_identity_file)
if identity_file
opts[:key_files] = [identity_file]
@@ -962,6 +969,7 @@ class Chef
# should we change that for consistency?
def sudo_opts
return {} if winrm?
+
opts = { sudo: false }
if config[:use_sudo]
opts[:sudo] = true
@@ -977,6 +985,7 @@ class Chef
def winrm_opts
return {} unless winrm?
+
auth_method = config_value(:winrm_auth_method, :winrm_auth_method, "negotiate")
opts = {
winrm_transport: auth_method, # winrm gem and train calls auth method 'transport'
@@ -1085,6 +1094,7 @@ class Chef
def session_timeout
timeout = config_value(:session_timeout)
return options[:session_timeout][:default] if timeout.nil?
+
timeout.to_i
end
end