- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Chef find out parent cookbook in dependency
- Date: Tue, 23 Jun 2015 11:47:30 -0700
On Thursday, June 18, 2015 at 9:20 AM, M G wrote:
>
Hi
>
>
>
Lets say I have cookbook base and 2 cookbooks child1 and child 2
>
>
In cookbook child1s recipe , I include base in the following manner:
>
>
child1/recipes/default.rb
>
>
include_recipe "base"
>
>
The same setup for child2's default recipe
>
>
Now in base, is there a way to find out which is the calling cookbook
>
child1 or child2?
It might be possible in some terribly ugly way (like looking at `caller` to
inspect the call stack) but you’re better off using some other mechanism (set
a value in attributes or `node.run_state`).
>
>
Regards
>
>
mg
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.