Recipe Compile Error in /var/chef/cache/cookbooks/nagios/recipes/server.rb
================================================================================
NoMethodError
-------------
undefined method `each' for nil:NilClass
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/nagios/recipes/server.rb:156:in `block in from_file'
/var/chef/cache/cookbooks/nagios/recipes/server.rb:155:in `each'
/var/chef/cache/cookbooks/nagios/recipes/server.rb:155:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/nagios/recipes/server.rb:
149: unmanaged_hosts = nagios_bags.get('nagios_unmanagedhosts')
150: serviceescalations = nagios_bags.get('nagios_serviceescalations')
151: contacts = nagios_bags.get('nagios_contacts')
152: contactgroups = nagios_bags.get('nagios_contactgroups')
153:
154: # Add unmanaged host hostgroups to the hostgroups array if they don't already exist
155: unmanaged_hosts.each do |host|
156>> host['hostgroups'].each do |hg|
157: if !hostgroups.include?(hg)
158: hostgroups << hg
159: end
160: end
161: end
162:
163: # Load search defined Nagios hostgroups from the nagios_hostgroups data bag and find nodes
164: hostgroup_nodes= Hash.new
165: hostgroup_list = Array.new
[2015-08-04T17:05:01-04:00] ERROR: Running exception handlers
[2015-08-04T17:05:01-04:00] ERROR: Exception handlers complete
[2015-08-04T17:05:01-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated
[2015-08-04T17:05:01-04:00] ERROR: undefined method `each' for nil:NilClass
[2015-08-04T17:05:01-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
You have new mail in /var/spool/mail/root
Archive powered by MHonArc 2.6.16.