- From: "Julian C. Dunn" <
>
- To:
- Subject: [chef] Re: which cookbook version used in chef-client run?
- Date: Thu, 10 Oct 2013 08:44:12 -0400
It's a little dirty, but if you crack open the run context you can do it:
---8<--- cut here ---8<---
log "---Writing all ckbks and versions---"
cookbooks = @run_context.cookbook_collection
log "The recipes were these: #{cookbooks.keys.map {|x|
cookbooks[x].name + " " + cookbooks[x].version} }"
log "---End Writing all ckbks and versions---
---8<--- cut here ---8<---
Credit goes to Sean Horn for this tidbit of code.
- Julian
On Thu, Oct 10, 2013 at 6:03 AM, Florian Hehlen
<
>
wrote:
>
Hi,
>
>
>
>
Is there a way to list or to log which cookbook version was used during a
>
chef-client run. I know I can crack open metadata.rb files in the chef/cache
>
directory but that is a bit clunky. It is also usefull information to log I
>
would say.
>
>
>
>
Cheers,
>
>
Flo
--
[ Julian C. Dunn
<
>
* Sorry, I'm ]
[ WWW:
http://www.aquezada.com/staff/julian * only Web 1.0 ]
[
gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
Archive powered by MHonArc 2.6.16.