- From: Vincent Jorgensen <
>
- To: "<
>" <
>
- Subject: [chef] Re: Ad-hoc tasks and ad-hoc sources
- Date: Fri, 2 Mar 2012 05:14:37 +0000
- Accept-language: en-US
This has come up in my travels as well, and I never came up with a viable ad-hoc solution, so the community's input is of interest to me, as well.
I have found that a well-crafted runlist can re-execute really fast if there is only one cookbook change, but it requires being extremely diligent about service notifications. But it has almost the same effect as an ad-hoc recipe might.
On Mar 1, 2012, at 8:50 PM, Three Tee wrote: Are there any best practices that have emerged around executing ad-hoc tasks via Chef? A use case that seems to come up often for me is performing code deployments using the application cookbook without executing any other configuration tasks that would usually be executed by the run_list. I understand that with Chef one typically considers a deployment to be inclusive of the prerequisite package installations, etc., but humor me for a bit. :)
Anyway, a couple of ways that I thought the above might be handled are to either set the run_list on the fly prior to the chef-client run, or to execute chef-client on the target nodes with the -j option, passing it an ad hoc run_list in the JSON. The former would require the previous run_list to be saved, then restored after the chef-client run (assuming it is successful). The latter appears to set the run_list on the Chef server after the chef-client run. Both options seem to make it difficult to use the nodes' run_list settings on the Chef server as a source of truth for a node's function, so I'm not really happy with either one.
I'd love to hear how you all have handled the above problem. Or maybe I'm just looking at this the wrong way? In any case, thanks in advance for any advice.
Also on this topic, I noticed the following on http://wiki.opscode.com/display/chef/FAQ:
"...by making Chef's Resources capable of taking action from ad-hoc sources. (This isn't released yet, but it will be soon - and trust us, it is awesome.)"
The above seems promising for the use case I described, and is interesting in general. Can anyone provide any more detail on this? Thanks everyone!
|
Archive powered by MHonArc 2.6.16.