- From: Phil Mocek <
>
- To:
- Subject: [chef] Re: What is a simple method to arrange e-mail notification of failed convergence?
- Date: Tue, 25 Nov 2014 18:54:18 +0000
Daniel DeLeo wrote:
>
there are already ones written that do what you’re asking, like
>
this one: https://github.com/kisoku/chef-handler-mail
That's not quite what I'm asking, which is for a simple method to
configure chef-client to send an e-mail to a particular address if
convergence fails. Apparently, to use chef-handler-email, I need
to install one or more gems on client systems (that sounds like a
half-day of dependency hell), or use the provided LWRP in a recipe
of my creation. If that's the simplest way to get an e-mail from
chef-client on failure, I'm disappointed, and concerned that I
have miscommunicated my goal.
>
A super simple example is provided in the docs you linked:
>
https://docs.getchef.com/essentials_handlers.html#syntax if you
>
just want to copy pasta that code.
That appears to be a simple example *of how to write a custom
handler*. I do not want to write a custom handler. All I really
need to customize is the e-mail address to which notifications
should be sent, like cron's MAILTO setting.
>
If you’re interested in other community-contributed handlers,
>
there’s a list at the bottom of the documentation page:
>
https://docs.getchef.com/essentials_handlers.html#community-handlers
That is preferable to writing my own handler. It still appears to
require writing a recipe. I'm busy writing recipes to deploy and
configure software and virtual infrastructure. I just want to
tell chef-client to send an e-mail when it fails.
>
Also, there is a chef_handler cookbook that will manage handlers
>
for you, some documentation on that is here:
>
https://docs.getchef.com/resource_chef_handler.html (GH:
>
https://github.com/opscode-cookbooks/chef_handler)
That's also useful, and also far more complicated than I hoped it
would be just to get chef-client to send an e-mail on failure.
I feel like I must be missing something. My goal, here, seems
likely to be a common one, and Chef generally handles those well
without much work on the user's part.
Thanks for the suggestions, Daniel. I suspect I will end up using
some of what you referenced.
--
Phil Mocek
https://mocek.org
Archive powered by MHonArc 2.6.16.