Installing handlers with chef_handler

Hiya,

I would like to write a simple chef report handler, to distribute it
to my chef clients, and to get chef-client to use it.

The documentation
(http://wiki.opscode.com/display/chef/Exception+and+Report+Handlers)
points out the chef_handler cookbook, which exists to distribute and
install handlers. That’s exactly what I want to do, but I can’t get
it to work.

jtimberman blogged a very simple report handler example:
http://jtimberman.posterous.com/a-simple-report-handler

I added this to my fork of the chef_handler repo
(https://github.com/zts/chef_handler/) and made sure that
recipe[chef_handler] would distribute the file - which it did. I then
configured /etc/chef/client.rb per the blog, and confirmed that the
handler worked:
<–snip–>
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Running report handlers
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Resources updated this run:
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: remote_directory[/var/chef/handlers]
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Report handlers complete

However, I’d prefer not to be editing client.rb when the chef_handler
cookbook has a provider for this purpose.
I reverted the changes to client.rb, and added a recipe -
chef_handler::updated_resources. It looks like this:
chef_handler “SimpleReport::UpdatedResources” do
Chef::Log.info "Loading handler from:
#{node[‘chef_handler’][‘handler_path’]}/updated_resources.rb"
source "#{node[‘chef_handler’][‘handler_path’]}/updated_resources.rb"
action :nothing
end.run_action(:enable)

Then set it as my run_list:
$ knife node show kakistos.local -a run_list
run_list: recipe[chef_handler::updated_resources]

Unfortunately, it blows up:
[Thu, 21 Jul 2011 15:19:24 +0100] INFO: Loading handler from:
/var/chef/handlers/updated_resources.rb
[Thu, 21 Jul 2011 15:19:24 +0100] INFO: Processing
chef_handler[SimpleReport::UpdatedResources] action enable
(chef_handler::updated_resources line 4)
[Thu, 21 Jul 2011 15:19:24 +0100] ERROR:
chef_handler[SimpleReport::UpdatedResources]
(chef_handler::updated_resources line 4) has had an error

And the stacktrace:
NameError: chef_handler[SimpleReport::UpdatedResources]
(chef_handler::updated_resources line 4) had an error: uninitialized
constant Kernel::SimpleReport
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in const_get' /var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:inblock (2 levels) in class_from_file’
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in each' /var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:ininject’
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in
block in class_from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/provider.rb:104:ininstance_eval’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/provider.rb:104:in
block in action' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/resource.rb:417:inrun_action’
/var/chef/cache/cookbooks/chef_handler/recipes/updated_resources.rb:8:in
from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/from_file.rb:30:ininstance_eval’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/from_file.rb:30:in
from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/cookbook_version.rb:578:inload_recipe’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:40:in
block in include_recipe' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:27:ineach’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:27:in
include_recipe' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:72:inblock in load’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:69:in
each' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:69:inload’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/client.rb:195:in
setup_run_context' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/client.rb:159:inrun’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:239:in
block in run_application' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:229:inloop’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:229:in
run_application' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application.rb:66:inrun’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/bin/chef-client:26:in
<top (required)>' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/chef-client:19:inload’
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/chef-client:19:in `’

Questions:

  • Have I made a mistake, or am I hitting a bug?
  • Am I going about this the right way?

Undeterred, and assuming that perhaps that would be an obvious fault
to someone more familiar with ruby, I changed tack and tried the
chef_handler::json_file recipe. This is documented as enabling the
JsonFile report handler which is bundled with chef. While it doesn’t
explode, it doesn’t appear to do anything either:
[Thu, 21 Jul 2011 14:55:35 +0100] INFO: Run List expands to
[chef_handler::json_file]
[Thu, 21 Jul 2011 14:55:35 +0100] INFO: Starting Chef Run for kakistos.local
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Loading cookbooks [chef_handler]
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action enable
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action nothing
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Chef Run complete in 4.402447 seconds
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Running report handlers
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Report handlers complete

The relevant chunk of the debug output:
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading cookbook
chef_handler’s providers from
/var/chef/cache/cookbooks/chef_handler/providers/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loaded contents of
/var/chef/cache/cookbooks/chef_handler/providers/default.rb into a
provider named chef_handler defined in Chef::Provider::ChefHandler
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading cookbook
chef_handler’s resources from
/var/chef/cache/cookbooks/chef_handler/resources/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loaded contents of
/var/chef/cache/cookbooks/chef_handler/resources/default.rb into a
resource named chef_handler defined in Chef::Resource::ChefHandler
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Node kakistos.local loading
cookbook chef_handler’s attribute file
/var/chef/cache/cookbooks/chef_handler/attributes/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading Recipe
chef_handler::json_file via include_recipe
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Found recipe json_file in
cookbook chef_handler
[Thu, 21 Jul 2011 14:58:46 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action enable
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Chef::Handler::JsonFile has
not been loaded
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Converging node kakistos.local
[Thu, 21 Jul 2011 14:58:46 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action nothing
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Doing nothing for
chef_handler[Chef::Handler::JsonFile]

Questions:

  • Should this have done something?
  • How should I approach debugging this issue? (I’m really not sure
    where to start)

All examples above are 0.10.2, on OS X, installed from gems. I’ve
also tried to get this working on an ubuntu VM, but met with exactly
the same results.

Thanks,

Zac

Zac,
You may have stumbled across a bug. I will try to recreate and open a COOK ticket if appropriate.

The JsonFile handler should drop a JSON file in '/var/chef/reports' when it fires.

Also, we recommend you get cookbooks from the community site using 'knife cookbook site install' or 'knife cookbook site download'. The repository you forked, Multiple vendor Chef cookbooks. · GitHub is not an Opscode account, and we don't know what the state of the cookbooks in that repository might be. Opscode maintains the GitHub repository for development tracking, but not for released versions of cookbooks we can support. We push the released versions to community.opscode.com. For more information see.

Seth

--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo

[0] Future of Opscode Cookbooks - Chef Blog | Chef

On Thursday, July 21, 2011 at 10:38 AM, Zac Stevens wrote:

Hiya,

I would like to write a simple chef report handler, to distribute it
to my chef clients, and to get chef-client to use it.

The documentation
(http://wiki.opscode.com/display/chef/Exception+and+Report+Handlers)
points out the chef_handler cookbook, which exists to distribute and
install handlers. That's exactly what I want to do, but I can't get
it to work.

jtimberman blogged a very simple report handler example:
http://jtimberman.posterous.com/a-simple-report-handler

I added this to my fork of the chef_handler repo
(GitHub - zts/chef_handler: A Chef cookbook for chef_handler) and made sure that
recipe[chef_handler] would distribute the file - which it did. I then
configured /etc/chef/client.rb per the blog, and confirmed that the
handler worked:
<--snip-->
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Running report handlers
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Resources updated this run:
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: remote_directory[/var/chef/handlers]
[Thu, 21 Jul 2011 15:14:52 +0100] INFO: Report handlers complete

However, I'd prefer not to be editing client.rb when the chef_handler
cookbook has a provider for this purpose.
I reverted the changes to client.rb, and added a recipe -
chef_handler::updated_resources. It looks like this:
chef_handler "SimpleReport::UpdatedResources" do
Chef::Log.info (http://Log.info) "Loading handler from:
#{node['chef_handler']['handler_path']}/updated_resources.rb"
source "#{node['chef_handler']['handler_path']}/updated_resources.rb"
action :nothing
end.run_action(:enable)

Then set it as my run_list:
$ knife node show kakistos.local -a run_list
run_list: recipe[chef_handler::updated_resources]

Unfortunately, it blows up:
[Thu, 21 Jul 2011 15:19:24 +0100] INFO: Loading handler from:
/var/chef/handlers/updated_resources.rb
[Thu, 21 Jul 2011 15:19:24 +0100] INFO: Processing
chef_handler[SimpleReport::UpdatedResources] action enable
(chef_handler::updated_resources line 4)
[Thu, 21 Jul 2011 15:19:24 +0100] ERROR:
chef_handler[SimpleReport::UpdatedResources]
(chef_handler::updated_resources line 4) has had an error

And the stacktrace:
NameError: chef_handler[SimpleReport::UpdatedResources]
(chef_handler::updated_resources line 4) had an error: uninitialized
constant Kernel::SimpleReport
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in const_get' /var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in each' /var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in inject'
/var/chef/cache/cookbooks/chef_handler/providers/default.rb:22:in
block in class_from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/provider.rb:104:in instance_eval'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/provider.rb:104:in
block in action' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/resource.rb:417:in run_action'
/var/chef/cache/cookbooks/chef_handler/recipes/updated_resources.rb:8:in
from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/from_file.rb:30:in instance_eval'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/from_file.rb:30:in
from_file' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/cookbook_version.rb:578:in load_recipe'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:40:in
block in include_recipe' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:27:in each'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/mixin/language_include_recipe.rb:27:in
include_recipe' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:72:in block in load'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:69:in
each' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/run_context.rb:69:in load'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/client.rb:195:in
setup_run_context' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/client.rb:159:in run'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:239:in
block in run_application' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:229:in loop'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application/client.rb:229:in
run_application' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/lib/chef/application.rb:66:in run'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.2/bin/chef-client:26:in
<top (required)>' /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/chef-client:19:in load'
/Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/chef-client:19:in `'

Questions:

  • Have I made a mistake, or am I hitting a bug?
  • Am I going about this the right way?

Undeterred, and assuming that perhaps that would be an obvious fault
to someone more familiar with ruby, I changed tack and tried the
chef_handler::json_file recipe. This is documented as enabling the
JsonFile report handler which is bundled with chef. While it doesn't
explode, it doesn't appear to do anything either:
[Thu, 21 Jul 2011 14:55:35 +0100] INFO: Run List expands to
[chef_handler::json_file]
[Thu, 21 Jul 2011 14:55:35 +0100] INFO: Starting Chef Run for kakistos.local
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Loading cookbooks [chef_handler]
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action enable
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:55:37 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action nothing
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Chef Run complete in 4.402447 seconds
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Running report handlers
[Thu, 21 Jul 2011 14:55:40 +0100] INFO: Report handlers complete

The relevant chunk of the debug output:
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading cookbook
chef_handler's providers from
/var/chef/cache/cookbooks/chef_handler/providers/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loaded contents of
/var/chef/cache/cookbooks/chef_handler/providers/default.rb into a
provider named chef_handler defined in Chef::Provider::ChefHandler
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading cookbook
chef_handler's resources from
/var/chef/cache/cookbooks/chef_handler/resources/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loaded contents of
/var/chef/cache/cookbooks/chef_handler/resources/default.rb into a
resource named chef_handler defined in Chef::Resource::ChefHandler
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Node kakistos.local loading
cookbook chef_handler's attribute file
/var/chef/cache/cookbooks/chef_handler/attributes/default.rb
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Loading Recipe
chef_handler::json_file via include_recipe
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Found recipe json_file in
cookbook chef_handler
[Thu, 21 Jul 2011 14:58:46 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action enable
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Chef::Handler::JsonFile has
not been loaded
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Converging node kakistos.local
[Thu, 21 Jul 2011 14:58:46 +0100] INFO: Processing
chef_handler[Chef::Handler::JsonFile] action nothing
(chef_handler::json_file line 24)
[Thu, 21 Jul 2011 14:58:46 +0100] DEBUG: Doing nothing for
chef_handler[Chef::Handler::JsonFile]

Questions:

  • Should this have done something?
  • How should I approach debugging this issue? (I'm really not sure
    where to start)

All examples above are 0.10.2, on OS X, installed from gems. I've
also tried to get this working on an ubuntu VM, but met with exactly
the same results.

Thanks,

Zac

Hi Seth,

On Thu, Jul 21, 2011 at 5:01 PM, Seth Chisamore schisamo@opscode.com wrote:

You may have stumbled across a bug. I will try to recreate and open a COOK ticket if appropriate.

Thanks for the prompt response - it's appreciated.

The JsonFile handler should drop a JSON file in '/var/chef/reports' when it fires.

Yeah, that's what I figured. Should it create the directory if it's
not present?
It didn't (assuming it fired), but creating the directory by hand
didn't change anything.

Also, we recommend you get cookbooks from the community site using 'knife cookbook site install' or 'knife cookbook site download'. The repository you forked, Multiple vendor Chef cookbooks. · GitHub is not an Opscode account, and we don't know what the state of the cookbooks in that repository might be. Opscode maintains the GitHub repository for development tracking, but not for released versions of cookbooks we can support. We push the released versions to community.opscode.com. For more information see.

Duly noted - I did start off this exercise using the official cookbook
(via "cookbook site install"), but cloning the unofficial repo seemed
to make for a cleaner example. I should have noted this in my
original post.

If the preference is to clone GitHub - chef-boneyard/cookbooks: DEPRECATED: This repository has been split up into separate repositories by cookbook under the "opscode-cookbooks" organization. as a whole,
I'll stick with that in future to avoid confusion.

Cheers,

Zac

Zac,
You could fork the repo, but the preferred way would be to just track the upstream cookbook in your local chef-repo using the 'vendor branch' pattern. An implementation of this pattern (that works with git) is built into 'knife cookbook site install'.

This command does the following:

  • Download the cookbook tarball from cookbooks.opscode.com.
  • Ensure its on the git master branch (or specify with --branch option).
  • Checks for an existing vendor branch, and creates if it doesn't.
  • Checks out the vendor branch (chef-vendor-COOKBOOK).
  • Removes the existing (old) version.
  • Untars the cookbook tarball it downloaded in the first step.
  • Adds the cookbook files to the git index and commits.
  • Creates a tag for the version downloaded.
  • Checks out the master (or desired) branch again.
  • Merges the cookbook into master (or desired branch).

For more information on 'knife cookbook site install' and the vendor pattern check out the wiki page [0] on the topic.

Seth

--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo

[0] http://wiki.opscode.com/display/chef/Working+with+Git+and+Cookbooks

On Thursday, July 21, 2011 at 12:14 PM, Zac Stevens wrote:

Hi Seth,

On Thu, Jul 21, 2011 at 5:01 PM, Seth Chisamore <schisamo@opscode.com (mailto:schisamo@opscode.com)> wrote:

You may have stumbled across a bug. I will try to recreate and open a COOK ticket if appropriate.

Thanks for the prompt response - it's appreciated.

The JsonFile handler should drop a JSON file in '/var/chef/reports' when it fires.

Yeah, that's what I figured. Should it create the directory if it's
not present?
It didn't (assuming it fired), but creating the directory by hand
didn't change anything.

Also, we recommend you get cookbooks from the community site using 'knife cookbook site install' or 'knife cookbook site download'. The repository you forked, Multiple vendor Chef cookbooks. · GitHub (Multiple vendor Chef cookbooks. · GitHub) is not an Opscode account, and we don't know what the state of the cookbooks in that repository might be. Opscode maintains the GitHub repository for development tracking, but not for released versions of cookbooks we can support. We push the released versions to community.opscode.com (http://community.opscode.com). For more information see.

Duly noted - I did start off this exercise using the official cookbook
(via "cookbook site install"), but cloning the unofficial repo seemed
to make for a cleaner example. I should have noted this in my
original post.

If the preference is to clone GitHub - chef-boneyard/cookbooks: DEPRECATED: This repository has been split up into separate repositories by cookbook under the "opscode-cookbooks" organization. (GitHub - chef-boneyard/cookbooks: DEPRECATED: This repository has been split up into separate repositories by cookbook under the "opscode-cookbooks" organization.) as a whole,
I'll stick with that in future to avoid confusion.

Cheers,

Zac

Hi Seth,

On Thu, Jul 21, 2011 at 5:26 PM, Seth Chisamore schisamo@opscode.com wrote:

You could fork the repo, but the preferred way would be to just track the upstream cookbook in your local chef-repo using the 'vendor branch' pattern. An implementation of this pattern (that works with git) is built into 'knife cookbook site install'.

This command does the following:
<--snip-->

Yup, I know all that - but it's not much good for being able to show
this list what I've done with the cookbook that I'm having trouble
with :slight_smile:

Other possible alternatives are pasting stuff into the message,
attaching files, or dumping stuff into gists - but all of those feel a
bit crufty.

In other words, there's a well-documented workflow for managing one's
own repository, when everything's going well. However, that workflow
doesn't seem well-suited either to soliciting help, or pushing
fixes/improvements upstream. It's those angles I'm struggling with.

Cheers,

Zac

Zac,
Totally understand.

So I was able to recreate the issue with your handler so I opened COOK-654 [0] and will try to get things fixed ASAP.

The JsonFile handler worked ok for me though. My file wrote out to:
/var/chef/reports/chef-run-report-20110721165525.json

Seth

--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo

[0] http://tickets.opscode.com/browse/COOK-654

On Thursday, July 21, 2011 at 12:37 PM, Zac Stevens wrote:

Hi Seth,

On Thu, Jul 21, 2011 at 5:26 PM, Seth Chisamore <schisamo@opscode.com (mailto:schisamo@opscode.com)> wrote:

You could fork the repo, but the preferred way would be to just track the upstream cookbook in your local chef-repo using the 'vendor branch' pattern. An implementation of this pattern (that works with git) is built into 'knife cookbook site install'.

This command does the following:
<--snip-->

Yup, I know all that - but it's not much good for being able to show
this list what I've done with the cookbook that I'm having trouble
with :slight_smile:

Other possible alternatives are pasting stuff into the message,
attaching files, or dumping stuff into gists - but all of those feel a
bit crufty.

In other words, there's a well-documented workflow for managing one's
own repository, when everything's going well. However, that workflow
doesn't seem well-suited either to soliciting help, or pushing
fixes/improvements upstream. It's those angles I'm struggling with.

Cheers,

Zac

Zac,
The chef_handler cookbook should be all fixed [0]. Please try version 1.0.4 which can be downloaded from the community site [1]:

knife cookbook site install chef_handler

Hope that helps!

Seth

--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo

[0] http://tickets.opscode.com/browse/COOK-654
[1] http://community.opscode.com/cookbooks/chef_handler

On Thursday, July 21, 2011 at 12:37 PM, Zac Stevens wrote:

Hi Seth,

On Thu, Jul 21, 2011 at 5:26 PM, Seth Chisamore <schisamo@opscode.com (mailto:schisamo@opscode.com)> wrote:

You could fork the repo, but the preferred way would be to just track the upstream cookbook in your local chef-repo using the 'vendor branch' pattern. An implementation of this pattern (that works with git) is built into 'knife cookbook site install'.

This command does the following:
<--snip-->

Yup, I know all that - but it's not much good for being able to show
this list what I've done with the cookbook that I'm having trouble
with :slight_smile:

Other possible alternatives are pasting stuff into the message,
attaching files, or dumping stuff into gists - but all of those feel a
bit crufty.

In other words, there's a well-documented workflow for managing one's
own repository, when everything's going well. However, that workflow
doesn't seem well-suited either to soliciting help, or pushing
fixes/improvements upstream. It's those angles I'm struggling with.

Cheers,

Zac

Hi Seth,

On Thu, Jul 21, 2011 at 10:21 PM, Seth Chisamore schisamo@opscode.com wrote:

The chef_handler cookbook should be all fixed [0]. Please try version 1.0.4 which can be downloaded from the community site [1]:

Thanks again for fixing this so quickly!
Tested as working, and now in use in my mcollective cookbook (also on
the community site).

Cheers,

Zac