Class: Chef::Knife::BootstrapWindowsSsh

Inherits:
Bootstrap
  • Object
show all
Includes:
BootstrapWindowsBase
Defined in:
lib/chef/knife/bootstrap_windows_ssh.rb

Instance Method Summary collapse

Methods included from BootstrapWindowsBase

#bootstrap, #bootstrap_context, #bootstrap_template, #default_bootstrap_template, included, #load_correct_secret, #load_template, #render_template

Methods included from KnifeWindowsBase

#locate_config_value

Instance Method Details

#runObject



94
95
96
# File 'lib/chef/knife/bootstrap_windows_ssh.rb', line 94

def run
  bootstrap
end

#run_command(command = '') ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/chef/knife/bootstrap_windows_ssh.rb', line 98

def run_command(command = '')
  ssh = Chef::Knife::Ssh.new
  ssh.name_args = [ server_name, command ]
  ssh.config[:ssh_user] = locate_config_value(:ssh_user)
  ssh.config[:ssh_password] = locate_config_value(:ssh_password)
  ssh.config[:ssh_port] = locate_config_value(:ssh_port)
  ssh.config[:ssh_gateway] =  locate_config_value(:ssh_gateway)
  ssh.config[:identity_file] = config[:identity_file]
  ssh.config[:ssh_identity_file] = config[:ssh_identity_file] || config[:identity_file]
  ssh.config[:forward_agent] = config[:forward_agent]
  ssh.config[:manual] = true
  ssh.config[:host_key_verify] = config[:host_key_verify]
  ssh.run
end