orenoblog

エンジニアになりたいExcel方眼紙erの物語

opscode cookbooks yum 3.0.4でハマった

どうもこんにちは。

opscode cookbooksのyum 2系を利用していたのですが、3.0.4までバージョンが上がっていたので

  • 2系ではOKだったのに。。

base-cookbooks

include_recipe "yum::epel"
["bind-utils","sysstat", "dstat", "git","subversion","ntp","unzip",
"wget","curl","nkf","elinks","telnet","tcpdump",
"yum-utils", "man", "nc", "htop", "tmpwatch", "strace",
"monit", "logwatch", "clamav", "mailx", "mlocate"].each do |pkg|
  package pkg
end

run_list

run_list = [ "recipe[base-cookbooks]" ]

エラーが...

[2014-02-18T04:15:13+00:00] INFO: Forking chef instance to converge...
[2014-02-18T04:15:13+00:00] INFO: *** Chef 11.8.0 ***
[2014-02-18T04:15:13+00:00] INFO: Chef-client pid: 2206
[2014-02-18T04:15:13+00:00] INFO: Setting the run_list to ["recipe[base-cookbooks]"] from JSON
[2014-02-18T04:15:13+00:00] INFO: Run List is [recipe[base-cookbooks]]
[2014-02-18T04:15:13+00:00] INFO: Run List expands to [base-cookbooks]
[2014-02-18T04:15:13+00:00] INFO: Starting Chef Run for localhost
[2014-02-18T04:15:13+00:00] INFO: Running start handlers
[2014-02-18T04:15:13+00:00] INFO: Start handlers complete.
[2014-02-18T04:15:14+00:00] ERROR: Running exception handlers
[2014-02-18T04:15:14+00:00] ERROR: Exception handlers complete
[2014-02-18T04:15:14+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-02-18T04:15:14+00:00] ERROR: undefined method `[]' for nil:NilClass

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/base-cookbooks/recipes/default.rb
================================================================================


NoMethodError
-------------
undefined method `[]' for nil:NilClass


Cookbook Trace:
---------------
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum-epel/recipes/default.rb:24:in `block (2 levels) in from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum-epel/recipes/default.rb:23:in `block in from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum-epel/recipes/default.rb:20:in `each'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum-epel/recipes/default.rb:20:in `from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/base-cookbooks/recipes/default.rb:14:in `from_file'


Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum-epel/recipes/default.rb:

 17:  # limitations under the License.
 18:
 19:  %w{
 20:    epel epel-debuginfo epel-source
 21:    epel-testing epel-testing-debuginfo epel-testing-source
 22:    }.each do |repo|
 23:    yum_repository repo do
 24>>     description node['yum'][repo]['description']
 25:      baseurl node['yum'][repo]['baseurl']
 26:      mirrorlist node['yum'][repo]['mirrorlist']
 27:      gpgcheck node['yum'][repo]['gpgcheck']
 28:      gpgkey node['yum'][repo]['gpgkey']
 29:      enabled node['yum'][repo]['enabled']
 30:      cost node['yum'][repo]['cost']
 31:      exclude node['yum'][repo]['exclude']
 32:      enablegroups node['yum'][repo]['enablegroups']
 33:      failovermethod node['yum'][repo]['failovermethod']

[2014-02-18T04:15:13+00:00] INFO: Forking chef instance to converge...
[2014-02-18T04:15:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
  • 修正後

includeやめました。

run_list = [ "recipe[yum-epel]", "recipe[base-cookbooks]" ]