I've created a chef cookbook, which has lot's of dependencies to other cookbooks. My main problem now is that the recipes from other cookbooks are executed in the random order. If I specify the execution of these recipes in the vagrant file like:
chef.add_recipe "gitlab::core_prereq"
chef.add_recipe "postfix"
chef.add_recipe "gitlab::users_prereq"
chef.add_recipe "rvm::vagrant"
chef.add_recipe "rvm::system"
chef.add_recipe "ohai"
chef.add_recipe "nginx"
chef.add_recipe "gitlab::python_tools_prereq"
chef.add_recipe "gitlab::gitolite_prereq"
chef.add_recipe "gitlab::gitlab_install"
Everything works fine, but I would like to have this spec in the recipe, so that a user just needs to include the default recipe and gets everything needed installed in the right order.
How can I solve this? Should I use a role? I don't get it from the chef docs, if the role can be specified within a recipe.