我正在尝试使用knife solo
and测试厨师食谱vagrant
。
使用提供的信息vagrant ssh-config
,我可以连接到我的流浪主机,如下所示:
ssh -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost
我打电话knife solo
给:
knife solo prepare -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost -VV
这引发了异常:
ERROR: Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
堆栈跟踪:
Bootstrapping Chef...
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:90:in `rescue in initialize': Net::SSH::ConnectionTimeout (Net::SSH::ConnectionTimeout)
from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:57:in `initialize'
from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `new'
from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `start'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_connection.rb:42:in `session'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:153:in `try_connection'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:194:in `detect_authentication_method'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:290:in `run_command'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:71:in `operating_system'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:67:in `bootstrap'
from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:57:in `run'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:442:in `block in run_with_pretty_exceptions'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local_mode.rb:44:in `with_server_connectivity'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:441:in `run_with_pretty_exceptions'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:219:in `run'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in `run'
from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in `<top (required)>'
from /usr/local/bin/knife:22:in `load'
from /usr/local/bin/knife:22:in `<main>'
不确定是什么可能导致knife solo
失败。我也尝试过指定-P
vagrant 密码而不是身份文件,效果相同。
如何连接knife solo
到本地主机?
谢谢你的帮助!