I want my chef-client to run when something is changed in cookbooks. Is it possible?
I find this "run once in X min" not very optimal. When I change something I want it to be applied immediately so I can notice if something went wrong. Other than that it can run once in say 4 hours just to make sure that config is in good shape.
Very much possible, but not build in. One options is to put your cookbooks in source control, and then use a CI tool such as Jenkins to trigger a chef-client run using
knife ssh
anytime the cookbook is updated.Alternately, you can manually run
knife ssh
to runchef-client
on all machines after you update a cookbook.There is not a push functionality built into the chef server.
Install a recipe auditing tool such as https://github.com/jbz/knife-audit. As part of your scripts that upload the cookbook, query the chef server for all nodes that use that recipe and call chef-client on them.