lib/chef/knife/bootstrap_windows_ssh.rb in knife-windows-1.9.6 vs lib/chef/knife/bootstrap_windows_ssh.rb in knife-windows-3.0.3
- old
+ new
@@ -23,17 +23,17 @@
class BootstrapWindowsSsh < Bootstrap
include Chef::Knife::BootstrapWindowsBase
deps do
- require 'chef/knife/core/windows_bootstrap_context'
require 'chef/json_compat'
require 'tempfile'
require 'highline'
require 'net/ssh'
require 'net/ssh/multi'
Chef::Knife::Ssh.load_deps
+ Chef::Knife::Bootstrap.load_deps
end
banner "knife bootstrap windows ssh FQDN (options)"
option :ssh_user,
@@ -72,44 +72,25 @@
option :ssh_identity_file,
:short => "-i IDENTITY_FILE",
:long => "--ssh-identity-file IDENTITY_FILE",
:description => "The SSH identity file used for authentication"
- # DEPR: Remove this option for the next release.
- option :host_key_verification,
- :long => "--[no-]host-key-verify",
- :description => "Verify host key, enabled by default. [DEPRECATED] Use --host-key-verify option instead.",
- :boolean => true,
- :default => true,
- :proc => Proc.new { |key|
- Chef::Log.warn("[DEPRECATED] --host-key-verification option is deprecated. Use --host-key-verify option instead.")
- config[:host_key_verify] = key
- }
-
option :host_key_verify,
:long => "--[no-]host-key-verify",
:description => "Verify host key, enabled by default.",
:boolean => true,
:default => true
def run
- validate_name_args!
- bootstrap
- end
-
- 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
+ Chef::Application.fatal!(<<~EOM
+ *knife windows bootstrap ssh*
+ Core Chef now supports bootstrapping Windows systems without a knife plugin
+
+ Use 'knife bootstrap -o ssh' instead.
+
+ For more detail https://github.com/chef/chef/blob/master/RELEASE_NOTES.md#knife-bootstrap
+ EOM
+ )
end
end
end
end