Chef v10.14.4, application v1.0.2
I am developing a cookbook to deploy a simple jekyll based blog. I use 'application' cookbook as a base. Everything works smoothly except chef simply ignores my defined callbacks.
Chef log contains entries about my callback, but I see no errors or outcomes of the callback execution.
Here is recipes/default.rb file:
<!-- language: ruby -->
Here is the log where chef-client says it executes before_deploy callback:
I also tried to define callback using string, but the result is the same. Chef shows error when there is no file with callback definition and simply ignores the file if it is in the right place.
After digging deeper inside Chef sources I realized that callbacks are executed in separate chef runner and this happens not instantly. When code in application cookbook calls recipe_eval to evaluate callback body Chef creates separate runner and the code does not executed until something call converge method.
So, I modified application cookbook a bit. I added call converge just after recipe_eval and everything started to work.
I think this is a bug and I am going to create an issue in official Opscode tracker. However, any comments are very welcome!
Here is modifed version of application/libraries/default.rb: