Re: Search on included cookbooks


#1

The best idea coming to my head is doing a comparison between runlist and expanded runlist, but it involves handling roles...

Unsure of what you mean with chef search, if it's to filter nodes having a recipe by includes that's ok but if it's to know which recipe is included that's harder, knife-audit is a good candidate for the last option.

All in all, can you give a use case for cleaner answer ?

Le 22 janv. 2015 20:10, sd <dioda11@gmail.com> a écrit :

Hi,

Not sure if this is available in the latest version but is possible to see the cookbooksincluded from other cookbooks by doing a chef search ?

thanks!

-silviu


#2

Hi,

You can find the cookbooks used by a node’s run list by doing a search.
All good as long as you use all cookbooks into the run list or you have a
role.
I’m referring to something like this

run_list [“wrap_cookbook”]

And into wrap_cookbook::default you could have something like

include_recipe "cookbook_one"
include_recipe “cookbook_two”

So what I want is to search on the chef server and see what nodes use
cookbook_one.

thanks!

-silviu

On Thu, Jan 22, 2015 at 2:45 PM, Tensibai Zhaoying tensibai@iabis.net
wrote:

The best idea coming to my head is doing a comparison between runlist and
expanded runlist, but it involves handling roles…

Unsure of what you mean with chef search, if it’s to filter nodes having a
recipe by includes that’s ok but if it’s to know which recipe is included
that’s harder, knife-audit is a good candidate for the last option.

All in all, can you give a use case for cleaner answer ?
Le 22 janv. 2015 20:10, sd dioda11@gmail.com a écrit :

Hi,

Not sure if this is available in the latest version but is possible to see
the cookbooks
included from other cookbooks by doing a chef search ?

thanks!

-silviu


#3

The expanded run list in node[‘recipes’] will now include recipes that were
added via include_recipe statements.

It looks like this was added in 11.8 per this ticket:

https://tickets.opscode.com/browse/CHEF-4777

Cheers,
Joshua

On Thu, Jan 22, 2015 at 1:03 PM, sd dioda11@gmail.com wrote:

Hi,

You can find the cookbooks used by a node’s run list by doing a search.
All good as long as you use all cookbooks into the run list or you have a
role.
I’m referring to something like this

run_list [“wrap_cookbook”]

And into wrap_cookbook::default you could have something like

include_recipe "cookbook_one"
include_recipe “cookbook_two”

So what I want is to search on the chef server and see what nodes use
cookbook_one.

thanks!

-silviu

On Thu, Jan 22, 2015 at 2:45 PM, Tensibai Zhaoying tensibai@iabis.net
wrote:

The best idea coming to my head is doing a comparison between runlist and
expanded runlist, but it involves handling roles…

Unsure of what you mean with chef search, if it’s to filter nodes having
a recipe by includes that’s ok but if it’s to know which recipe is included
that’s harder, knife-audit is a good candidate for the last option.

All in all, can you give a use case for cleaner answer ?
Le 22 janv. 2015 20:10, sd dioda11@gmail.com a écrit :

Hi,

Not sure if this is available in the latest version but is possible to
see the cookbooks
included from other cookbooks by doing a chef search ?

thanks!

-silviu


Joshua Timberman, Code Cleric


#4

+1 to what joshua said,
it used to not work earlier, now that bug is fixed. Both top level recipes
(that are added via run list) and included_recipes (added by other recipes)
can be searched against the recipes attribute (similar to roles).

though theres no clear way to distinguish between top level recipe and
included recipe, and i think thats fine, you can do that by subtracting the
run_list recipes :slight_smile:

On Thu, Jan 22, 2015 at 12:34 PM, Joshua Timberman joshua@chef.io wrote:

The expanded run list in node[‘recipes’] will now include recipes that
were added via include_recipe statements.

It looks like this was added in 11.8 per this ticket:

https://tickets.opscode.com/browse/CHEF-4777

Cheers,
Joshua

On Thu, Jan 22, 2015 at 1:03 PM, sd dioda11@gmail.com wrote:

Hi,

You can find the cookbooks used by a node’s run list by doing a search.
All good as long as you use all cookbooks into the run list or you have a
role.
I’m referring to something like this

run_list [“wrap_cookbook”]

And into wrap_cookbook::default you could have something like

include_recipe "cookbook_one"
include_recipe “cookbook_two”

So what I want is to search on the chef server and see what nodes use
cookbook_one.

thanks!

-silviu

On Thu, Jan 22, 2015 at 2:45 PM, Tensibai Zhaoying tensibai@iabis.net
wrote:

The best idea coming to my head is doing a comparison between runlist
and expanded runlist, but it involves handling roles…

Unsure of what you mean with chef search, if it’s to filter nodes having
a recipe by includes that’s ok but if it’s to know which recipe is included
that’s harder, knife-audit is a good candidate for the last option.

All in all, can you give a use case for cleaner answer ?
Le 22 janv. 2015 20:10, sd dioda11@gmail.com a écrit :

Hi,

Not sure if this is available in the latest version but is possible to
see the cookbooks
included from other cookbooks by doing a chef search ?

thanks!

-silviu


Joshua Timberman, Code Cleric