为什么 chef-metal-ssh 失败

why chef-metal-ssh is failed

我正试图关注 https://github.com/double-z/chef-metal-ssh 我是 运行 下面的代码,它抛出异常: [2015-01-19T06:03:39-06:00] 错误:machineone 出现错误:ArgumentError:参数数量错误(2 代表 0)

require 'chef_metal_ssh'

name = "one"

with_ssh_cluster("~/metal_ssh")

machine name do
 action [:ready, :converge]
 machine_options 'ip_address' => '10.62.56.209',
 'ssh_options' => {
 'user' => 'root',
 'keys' => ['/home/chefuser/test.rsa']
}
files '/remote/path.txt' => { :content => 'foo' }
end

 machine_execute name do
    command "pwd" # this uses new_daemon_key to register with halo
 end

我想知道这段代码有什么问题。我不明白 with_ssh_cluster("~/metal_ssh") "~/metal_ssh" 中应该有什么内容?谢谢。

我不得不深入研究代码才能理解(我没有使用它)。

根据下面的评论发现here

# cluster_path - path to the directory containing the vagrant files,
# which should have been created with the vagrant_cluster resource.

“~/metal_ssh”文件应该是 Vagrantfile 路径。

chaf-metal-ssh 是 chef-metal 的驱动程序,我不确定您对 chef-metal 是否满意,所以我建议您先阅读 This and This

我发现问题是我使用的是 chef 12.0.3,在 /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/dsl/recipe.rb[ 的第 109 行=12=]

 resource.load_prior_resource(type, name)

但是在 chef-metal-ssh-0.1.2/lib/chef/resource/ssh_cluster.rb:18

定义为

 def load_prior_resource
   Chef::Log.debug("Overloading #{resource_name}.load_prior_resource with NOOP")
 end

所以它抛出

ArgumentError:参数数量错误(2 代表 0)