Class: Chef::Knife::BootstrapWindowsWinrm

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

Instance Method Summary collapse

Methods included from WinrmBase

included

Methods included from BootstrapWindowsBase

#bootstrap, #bootstrap_bat_file, #bootstrap_command, #create_bootstrap_bat_command, included, #load_template, #locate_config_value, #render_template

Instance Method Details

#runObject



38
39
40
# File 'lib/chef/knife/bootstrap_windows_winrm.rb', line 38

def run
  bootstrap
end

#run_command(command = '') ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/chef/knife/bootstrap_windows_winrm.rb', line 42

def run_command(command = '')
  winrm = Chef::Knife::Winrm.new
  winrm.name_args = [ server_name, command ]
  winrm.config[:winrm_user] = locate_config_value(:winrm_user)
  winrm.config[:winrm_password] = locate_config_value(:winrm_password)
  winrm.config[:winrm_transport] = locate_config_value(:winrm_transport)
  winrm.config[:kerberos_keytab_file] = Chef::Config[:knife][:kerberos_keytab_file] if Chef::Config[:knife][:kerberos_keytab_file]
  winrm.config[:kerberos_realm] = Chef::Config[:knife][:kerberos_realm] if Chef::Config[:knife][:kerberos_realm]
  winrm.config[:kerberos_service] = Chef::Config[:knife][:kerberos_service] if Chef::Config[:knife][:kerberos_service]
  winrm.config[:ca_trust_file] = Chef::Config[:knife][:ca_trust_file] if Chef::Config[:knife][:ca_trust_file]
  winrm.config[:manual] = true
  winrm.config[:winrm_port] = locate_config_value(:winrm_port)
  winrm
end