2015-01-26 82 views
0

我有配置mcollective並安裝以下service代理start/stop服務Mcollective廚師服代理無法運行

https://github.com/rottenbytes/mcollective/blob/master/plugins/agents/chef-service.rb

但是,當我運行它,它未能在client.build_node和我看到的錯誤undefined method reset_defaults_and_overrides for nil:NilClass (NoMethodError)

require 'chef' 
require 'chef/client' 
require 'chef/run_context' 
begin 

Chef::Config[:solo] = true 
Chef::Config[:log_level] = :debug 
Chef::Log.level(:debug) 
client = Chef::Client.new 
client.run_ohai 
client.build_node <-- its failing here 

如果我嘗試在我的外殼上運行,我得到以下內容

[[email protected] agent]# ruby /tmp/foo.rb 
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.2/lib/chef/policy_builder/expand_node_object.rb:117:in `build_node': undefined method `reset_defaults_and_overrides' for nil:NilClass (NoMethodError) 
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.2/lib/chef/client.rb:259:in `build_node' 
    from /tmp/foo.rb:11:in `<main>' 

我不是紅寶石專家,所以我不知道如何解決它。我只需要知道發生了什麼

回答

0

從外觀上看,足夠的廚師客戶端的內部API改變了,集體插件將不再工作。嘗試老版本的廚師寶石。

+0

我試過'1.8'和'1.9',但同樣的錯誤,我在哪裏得到新的API? – Satish 2015-01-27 00:20:46

+0

這些是Ruby版本,不是Chef版本。基本上在這和你過去的問題之間,你不能使用這個軟件。如果沒有潛入代碼中,它太破碎了,你自己也不願意這樣做。要麼聘請顧問,要麼找到另一種選擇: - /對不起,這個苛刻的答案。 – coderanger 2015-01-27 00:42:12