Provider not notified from cookbook_file

Posted by wittyhandle on Stack Overflow See other posts from Stack Overflow or by wittyhandle
Published on 2012-11-11T04:57:09Z Indexed on 2012/11/11 5:00 UTC
Read the original article Hit count: 166

Filed under:

I'm working on an ssl provider using Vagrant (1.0.5) and chef-solo (10.12.0)

I have my provider, called ssl within a cookbook called gtm_cq, I define it as such in my cookbook's default recipe:

gtm_cq_ssl "author" do
    # attributes will come later
end  

I then have my cookbook_file like below that should notify my ssl provider's import action once it pushes the cert up to the server:

cookbook_file "#{node[:cq][:ssl][:author_cert_location]}/foo.cer" do
    source "foo.cer"
    owner "crx"
    group "root"
    mode "0644"
    notifies :import, resources(:gtm_cq_ssl => "author")
end

When I run this, the foo.cer gets pushed up as expected, but the import action of my ssl provider is never called. The most I see of any reference is these couple of lines in the log (removed log headers):

.. cookbook_file[/opt/cq5/author/foo.cer] sending import action to gtm_cq_ssl[author] (delayed)
.. Processing gtm_cq_ssl[author] action import (gtm_cq::author line 34)

There's a large very obvious log statement as well as the use of another cookbook_file for a test file to push something up to the server. No log statement, no test file pushed. I'm certain too that the foo.cer file is removed from the server before each test.

I found that if I edit my notifies line like so with :immediately

notifies :import, resources(:gtm_cq_ssl => "author"), :immediately

It seems to work. And I suppose this is ok in my particular case, but it would seem something is not right if that's the only way I can call my provider.

Any help on this would be greatly appreciated.

Thanks!

© Stack Overflow or respective owner

Related posts about chef