Did I miss anything? While I'm not surprised by the information here, it confirms that there is a functional hole here-- there are many situations in a converged infrastructure that require multiple client runs before the infrastructure is fully functional, and this means it takes longer than absolutely necessary to bring up a new infrastructure from scratch.
I am aware that implementation of callbacks, or resource hooks on remote nodes, is a huge job, there are other ways to approach the situation. Another solution that comes to mind (besides the search-subscriber model): Make it easy for a recipe to advise the chef-client to reduce its run interval based on conditions detected in the chef-client run. I like this one because it is useful beyond the specific situation-- it gives the chef-client a primitive way to learn about the infrastructure it manages and respond appropriately.
At its core, I believe that requiring configuration to come via application-specific config files is the real issue here, but I don't expect to see network-wide integrated config resource support (such as in CoreOS's etcd) in most *nix tools in the near term, nor do I expect to see direct support for communication with Chef servers in our tools (so, for our trusty hypothetical example, nrpe could be instructed simply to perform a Chef search directly to determine the allowed nrpe-client IPs rather than have the chef-client write the nrpe.conf as part of convergence, then notify the nrpe server of the change).
TL;DR: Now I'm thinking that the best thing would be for the recipe to be able to advise the client to reduce the interval before the next run. This would enable code like
result = search(...)
if result.empty?
Chef::Client.advise_interval(300) # request a chef-client run 5 minutes (+/- splay) after this converge
end
# define resources below, using not_if { result.empty? } where appropriate
On 10/1/14, 12:48 PM, Justin Dossey wrote:
You can set `no_lazy_load true` in client.rb to avoid cookbook_file resources failing after 15m. This will be the default in Chef 12 client. The Chef 12 server also uses solr 4 and is going to populate search results in seconds rather than minutes.
would cause the recipe to poll the Chef server every ten seconds until a response came back, or until the client token expired (usually around 15 minutes).
Such behavior is not ideal (particularly because of the client token expiry issue) but besides supporting a second converge, it's the only way I have seen that will accomplish the desired result.
Archive powered by MHonArc 2.6.16.