Custom provider not working
I am trying to add a custom chef provider — Chef::Provider::Tarball based on Chef::Provider::Git.
For some reason it does not want to work. I added:
And also added reference to Chef::Provider::Tarball in /usr/lib/ruby/vendor_ruby/chef/provider/deploy.rb and /usr/lib/ruby/vendor_ruby/chef/providers.rb:
The error message I get is FATAL: NameError: uninitialized constant Chef::Provider::Tarball
Here is the full stack:
Any ideas what I could be missing?
Preventing an infinite notification loop with custom LWRP
I’ve built an LWRP that handles various tasks related to configuring and restarting my application (in order to re-use the actions between the deploy resource which I use in production and a separate recipe that runs the same steps on a local checkout for developer use).
I’m using the notifying_action pattern from http://realityforge.org/code/2012/07/17/lwrp-notify-on-changed-resources.html so that my app resource is marked as updated when any of the child resources change.
As part of this, I have a few actions that need to always notify a :clear_cache action also in the same resource. For example:
I am scheduling the :clear_cache action for :immediately as I need it to run before the apache restart which has usually already been queued by earlier recipes.
However, this causes an infinite loop – :clear_cache executes, but because it’s in the same resource that was earlier configured to execute :clear_cache it repeats.
The only way I’ve found to resolve this is in :clear_cache to add:
This feels fairly unclean, though it has the desired effect. But is there a better way either to remove the notification, or to schedule a delayed notification but ensure that it comes before the apache restart?