Cookbooks are sets of recipes to apply to a server to create systems made up of subsystems.
The Cookbook class is the base class for all cookbooks to be created from. If you over-ride any of the built-in functions, be sure to call the base class functions so that all the good stuff still happens. You will probably not need to sub-class any of the base functions in your cookbooks, though. They will all be called by frycooker as necessary. All you need to do is to fill the class-level variable recipe_list with class objects for recipes that you want to run when applying the cookbook. The recipes will be applied in the order they’re defined in the list.
Example:
from frycook import Cookbook
from recipes import RecipeNginx
from recipes import RecipeExampleCom
class CookbookWeb(Cookbook):
recipe_list = [RecipeNginx,
RecipeExampleCom]
Run the apply functions for all the recipes defined in recipe_list. Override this if there’s something you need to do besides just running all the recipes. Be sure to call the base class if you override this.
Parameters: | computer (string) – name of computer to apply recipe to |
---|
Run the post_apply_message functions for all the recipes defined in recipe_list. Override this if there are cookbook-level messages you would like to add. Be sure to call the base if you override this.
Run the pre_apply_message functions for all the recipes defined in recipe_list. Override this if there are cookbook-level messages you would like to add. Be sure to call the base if you override this.
Run the pre_apply_checks functions for all the recipes defined in recipe_list. Override this if there’s something you need to check above and beyond the recipe-level data. Be sure to call the base if you override this.
Parameters: | computer (string) – name of computer to apply recipe checks to |
---|