- From: Jeremy Voorhis <
>
- To:
- Subject: [chef] Re: Re: Preferred Attribute locations
- Date: Tue, 17 Jul 2012 21:35:28 -0700
I like your thinking around publishing and mutability. It seems Chef is growing up with the community's recent focus on modularity, and attributes are part of the interface to a cookbook.
I only tend to use role attributes to integrate cookbooks. I.e. if Varnish and Nginx are to run on the same node, use a role attribute to integrate them.
Setting sane defaults in cookbooks helps with modularization, and my recent cookbooks have a Vagrantfile and some code to test interacting with a vm from the outside. The Vagrantfile should work with chef-solo, and shouldn't require setting many attributes, if any.
We prefer to only store ephemeral or external data in data bags, such as credentials or the location of a service not managed by Chef. We also sometimes use it to override values that apply to an entire cluster.
Generally, I try to set attributes at the lowest possible preference because I don't know what I'll need to change later.
Jeremy
On Tuesday, July 17, 2012 at 4:44 PM, Peter Donald wrote:
Hi,
We tend to do the following.
* In the cookbook if an attribute is modifiable then it is set as a "default"
* In the cookbook if an attribute is not modifiable then it is set as
a "override". It is usually used to "publish" information to other
cookbooks. (i.e. The java cookbook may publish the path to the java
command line tool)
* In environments we only use override attributes all the time as our
environment ~= cluster
* We are moving from not having any attributes in roles (See below)
* We rarely if ever use normal attributes and usually it is only for
things like point of contact, business owner, or other cataloguing
information.
Our role specific configuration we tend to put in a recipe in a
"policy" cookbook as we often use a combination of searches, data bag
lookup and rules to syntesize the attributes and then we set them as
override. i.e. Just say we have a role "metric_server" that sets up a
graphite server that we can send metric data to. We would create a
"fisg-graphite" cookbook that generates the environment specific
configuration and then includes the appropriate recipes from the
graphite cookbook.
--
Cheers,
Peter Donald
- [chef] Preferred Attribute locations, Dylan Northrup, 07/17/2012
- [chef] Re: Preferred Attribute locations, Mike, 07/17/2012
- [chef] Re: Preferred Attribute locations, Denis Haskin, 07/17/2012
- [chef] Re: Preferred Attribute locations, Joshua Timberman, 07/17/2012
- [chef] Re: Preferred Attribute locations, Peter Donald, 07/17/2012
- [chef] Re: Re: Preferred Attribute locations, Jeremy Voorhis, 07/17/2012
Archive powered by MHonArc 2.6.16.