hectcastro / chef-collectd

A Chef cookbook to install collectd.
Apache License 2.0
23 stars 65 forks source link

Strange behavior while using attribute_driven recipe #18

Closed hochmann closed 10 years ago

hochmann commented 11 years ago

Hey, i'm using attribute_driven recipe and providing the following attribute as default while bootstrapping with vagrant:

default["collectd"]["graphite_ipaddress"] = "33.33.33.11"

NoMethodError


undefined method `[]=' for nil:NilClass

Cookbook Trace:


/tmp/vagrant-chef-1/chef-solo-1/cookbooks/collectd/recipes/attribute_driven.rb:15:in from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/applicaster/recipes/collectd-daemon.rb:13:infrom_file'

Relevant File Content:

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/collectd/recipes/attribute_driven.rb:

8: 9: if graphite_server_results.empty? 10: Chef::Application.fatal!("Graphite plugin enabled but no Graphite server found.") 11: else 12: node.default["collectd"]["plugins"]["write_graphite"]["config"]["Host"] = graphite_server_results[0]["ipaddress"] 13: end 14: else 15>> node.default["collectd"]["plugins"]["write_graphite"]["config"]["Host"] = node["collectd"]["graphite_ipaddress"] 16: end 17: 18: node.default["collectd"]["plugins"]["write_graphite"]["config"]["Port"] = 2003 19: end 20: 21: # flush all of configuration to conf.d/ 22: node["collectd"]["plugins"].each_pair do |plugin_key, definition| 23: # Graphite auto-discovery 24: collectd_plugin plugin_key.to_s do

can you comment what might be the cause?

hectcastro commented 11 years ago

Hey, are you trying to set the Graphite IP address from within another recipe?

hectcastro commented 10 years ago

Are you still having trouble with this?

hectcastro commented 10 years ago

Ping.

hochmann commented 10 years ago

Sorry for not reply earlier, started traveling around the world and some how now when back saw it.

Issue is no more relevant,

CLOSED