[chef] Re: SNS Handler


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: SNS Handler
  • Date: Thu, 24 Sep 2015 12:47:38 -0700

you are using erb syntax inside ruby file, use string interpolation instead
"Chef-run: #{ node.name} - #{ run_status.success? ? 'ok' : 'error' }"

i doubt node object is accessible inside the config file. so node.name wont work, sns handler will have access to this, it can be instrumented from there

there are several ways to do chef run reporting, it all depends upon what tools you are using. we use the datadog handler, cause we use datadog as monitoring system, you can use statsd or email handlers as well,

On Thu, Sep 24, 2015 at 12:41 PM, Doug Garstang < " target="_blank"> > wrote:
I've been trying to implement chef reporting to SNS with this:

I'm kind of confused about it all. I'm using the sns handler cookbook at https://github.com/onddo/chef_handler_sns-cookbook like it recommends.

The cookbook installs the dependancies, but I want to configure it via client.rb so that it will report on issues during the compile phase.

However, if I add this to client.rb like the doc says:
sns_handler.subject: "Chef-run: <%= node.name %> - <%= run_status.success? ? "ok" : "error" %>"

Then, I guess this isn't valid ruby or something because the chef client run fails with an error pointing here. :(

Is there a better way to chef run reporting?

Doug.




Archive powered by MHonArc 2.6.16.

§