[chef] Re: Re: Problems with log stash cookbook and environment attributes


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: Cassiano Leal < >
  • Cc:
  • Subject: [chef] Re: Re: Problems with log stash cookbook and environment attributes
  • Date: Thu, 8 Aug 2013 12:53:15 -0700


On Thursday, August 8, 2013 at 12:48 PM, Cassiano Leal wrote:

On August 8, 2013 at 16:13:52, Daniel DeLeo ( "> ) wrote:


On Tuesday, July 30, 2013 at 1:10 PM, Cassiano Leal wrote:

I’m having trouble using the community logstash cookbook with environment parameters.


When it tries to create shipper.conf it fails here:


Chef::Mixin::Template::TemplateError (comparison of String with Chef::Node::ImmutableMash failed) on line #13:
 
11: }
12: <% else %>
13: <%= LogstashConf.section_to_str(node['logstash']['agent']['inputs']) %>
14: <% end -%>
15: }

The full stack trace and the environment JSON can be found here: https://gist.github.com/cassianoleal/6116305

I have successfully used this cookbook on another environment when setting [:logstash][:agent][:inputs] via node.override in a recipe. What’s wrong with this approach?

Cheers,
If you haven't figured this out yet, it looks like you're ending up in a situation where the log stash cookbook has an array like:

  [ "string", "another string", {:attribute_data => "some data"}]

… And then calls #sort on that array. This implies that `node['logstash']['agent']['inputs']` is expected to be a string but is a hash instead. Or something like that.

I haven’t. I took a different path.

What you’re saying makes a lot of sense, though. This:

"override_attributes": {
"logstash": {
"agent": {
"inputs": {
"file": {
...
}
},

confirms that node[:logstash][:agent][:inputs] really is a Hash.

Thanks for the information, I’ll keep that in mind next time I do that! :)

Just to be clear, I don't personally have experience with the log stash cookbook, so I'm not sure what type it expects the input to be, just that somehow it's trying to sort things of different types, which ruby doesn't like.
 


-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§