Is it bad to have a CHEF wrapper cookbook for every environment? -
i new chef, , i'm trying setup cookbooks infrastructure.
i have several types of web servers. have base webserver cookbook, , have 3 wrapper cookbooks. 1 each type of web server.
base
- web
wrappers
- web_mail
- web_scheduled
- web_hsm
i want setup multiple environments qa , production servers can point different databases. (using variables in .erb templates). want use cookbook version promotion ensure each version tested in stage before production.
- production
- stage
- qa
- dev
while put database variables in environment attributes, or in roles, this blog, suggests that anti pattern , better use environment wrapper cookbooks.
however, if use environment wrapper cookbooks, have unmanageable 4x3 matrix of cookbooks (13 cookbooks total).
is there way combine wrapper cookbooks, multiple environments?
a better explanation of environment cookbook pattern given here:
"environment" cookbooks same "application" cookbook. idea capture applications logic in 1 place. cookbook attributes capture default settings.
when comes deployment want leverage chef's attribute precedence , override cookbook defaults using chef environment. secondary benefit of using environments can constrain cookbook versions applied @ run-time. means each deployed instance of cookbook customized in single place (the chef environment).
finally roles can used override cookbook attributes, best advised keep number of customization points minimum initially.
ps here's more detailed answer similar question:
Comments
Post a Comment