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


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

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! :)

-- 
Daniel DeLeo


--
Cassiano Leal
http://cassianoleal.com
http://twitter.com/cassianoleal



Archive powered by MHonArc 2.6.16.

§