0
votes

When creating or editing a Role in the GUI I can't find a way to add a cookbook. I have my recipes grouped in different cookbooks, but it seems when I create a role I have to add every recipe one by one. It does not make sense to me. For instance, I have a cookbook that adds about 30 configuration files, each one with its own recipe. I would like to add that cookbook to a role, I don't know how. It seems when I create a role I can add sub-roles and recipes, but not cookbooks. To me is like somebody asks me for my recipes for soups, and instead of giving him my book with soup recipes I start searching around for all my recipes about soup.

Any idea ?

Thanks,

Luis

1

1 Answers

0
votes

That's the way chef works. You set a run list of recipes.

If you wish to do all in one pass create a recipe named all_recipesfor exemple and containing

include_recipe "you_cookbook::recipe_name1"
include_recipe "you_cookbook::recipe_name2"
include_recipe "you_cookbook::recipe_name3"

But if you intent is to manage 30 files in the same way, you may loop over them in a single recipe instead of doing one recipe per file.

Having multiple recipes in a cookbook is more to manage different cases (service or cronjob, unix system or windows system, etc).

All in all it sounds like a bad design at first. (No judgement, just a feeling with the few information you gave)


For your soup exemple, you're taking it the wrong way. It's not that someone ask you for recipes, it's you telling a chef to cook things.

If you want him to cook everything in a cokbook, you have to tell him that's what you want, but a recipe for a particular soup may reference other 'common' recipes (like peel potatoes) etc.