Tom Duffield — Consulting Engineer
651.769.7497 – " style="color:rgb(105,117,130)" target="_blank"> – my: Linkedin Twitter
| ||
Ohai Chefs!
I have been reviewing the different cookbook design patterns and I'm coming to
a crossroad about where specific types of cookbooks fall. I have my idea but
some of the blog posts I have read recently seem to contradict mine. I am
going to list out a few cookbooks and where I think they fall and the reason I
have chosen to do it this way:
Library Cookbooks:
Cookbooks that provide lwrps and libraries that are used for building blocks.
May depend on another library cookbook. Most of the time these are from the
community.
Examples:
apt
yum
dns
Infrastructure Cookbooks:
Cookbooks that are like a library but have recipes for installing a service or
software that is not business software. May depend on other library or
infrastructure cookbooks.
java
apache2
mysql
mongodb
Wrapper Cookbooks:
Wrap a library or infrastructure cookbook. Uses the optimistic operator in
metadata for dependencies.
acme-java
acme-mysql
acme-mongodb
Application Cookbooks:
Installs and configures the software relating to my business. May depend on a
wrapper, library or infrastructure cookbook. Defines a run list so acts like a
role cookbook as well. Uses the optimistic operator for dependency version
management.
Examples:
my_rails_app
my_java_app
With the above patterns I would only lock my application cookbooks in my
environment files and all other version constraints would be handled at the
metadata.rb level. I would also use Berkshelf to manage the dependencies to
keep things sane.
I also have a few other cookbooks that I'm not sure where they fall and would
like some help on that. Such as a base cookbook that runs on all our nodes.
What pattern does that fall under?
I was also wondering about a "datacenter" cookbook which I brought up on a post
from Jullian
(http://www.getchef.com/blog/2013/12/03/doing-wrapper-cookbooks-right/#comment-1315553649)
about how best to handle various settings and potentially a few extra
resources/recipes that might need to be run in a particular datacenter. Does
any one have any thoughts on what cookbook pattern this type falls under? Any
examples would be greatly appreciated.
I'm sure a lot of folks have pondered over where their cookbook falls so at the
least I hope this sparks a good discussion.
- Jay
Archive powered by MHonArc 2.6.16.