|
Opscode provides a cookbook for distributing custom Chef Handlers.Add cookbook to chef-repoDownload the cookbook to your Chef Repository. Write Chef HandlerSee the Exception and Report Handlers page for instructions on how to write new Chef handlers. These files will go under cookbooks/chef_handler/files/default/handlers. Change the Handler PathIf you wish to change the directory where the handlers are copied, edit the cookbook attributes file and change the path for the node['chef_handler']['handler_path'] attribute. You can also set this value in a role. Enable the Chef Handler with the chef_handler LWRPAfter you distribute handler files down to the node, you have to enable it so Chef will know to fire it on the conclusion of Chef runs. This is very easy to do using the chef_handler LWRP. This LWRP requires, configures and enables handlers on the node for the current Chef run. It also has the ability to pass arguments to the handlers initializer, allowing initialization data to be pulled from a node's attribute data. It is best to declare `chef_handler` resources early on in the compile phase so they are available to fire for any exceptions during the Chef run. Upload to your Chef ServerThe cookbook needs to be uploaded to the Chef Server to be used. Add the recipe to a run listAdd the recipe[chef_handler] to a node or role run list. Put it first to make sure your custom handlers are loaded and available to other recipes. Additional InformationSee the README.md of the chef_handler cookbook for additional information.
|
|
|


