|
Answer» Handlers are used to solve different situations that arise during a Chef Client run. There are 3 types of handlers in Chef. - Exception: Exception handler is invoked whenever a situation arises where the Chef Client fails. A recipe with “chef_handler” resource is ADDED to the run list of a node which gets LOADED first on every Chef Client run.
- Report: Report handlers are used when Chef Client run succeeds and then wants to report back more information about the successful run. These are loaded first on every Chef Client run by adding a recipe with “chef_handler” resource on the nodes run list.
- START: Start handlers are used to trigger events at the start of a chef-client run. These could be loaded first on every Chef Client run by adding the “start_handlers” in the “client.rb” file. If we are USING chef-client cookbook start_handlers are installed using the “chef_gem” resource. Hence, “start_handlers” will be PRESENT on the node before a chef-client run.
Exception and report handlers provide a wide range of information about the Chef Client run and these data could be used for analysis across the organizations.
|