- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: How best to reprepresent a hosted site in Chef?
- Date: Fri, 4 Jun 2010 09:06:34 -0700
On Wed, Jun 2, 2010 at 1:31 PM, Dmitry V'yal
<
>
wrote:
>
>
>
>
> Ohai!
>
>
>
> If the sites are all very similar except for some data, you can just
>
> create them in a loop. Our documentation for libraries shows an
>
> example of creating vhosts based on data in a SQL database:
>
>
>
> http://wiki.opscode.com/display/chef/Libraries
>
>
>
> If this looks appealing, but you don't currently have the data in a
>
> database, you might want to use data bags to store the data:
>
>
>
> http://wiki.opscode.com/display/chef/Data+Bags
>
>
>
>
Hello Daniel.
>
>
Data bags seem like a way to go. Now, speaking in terms of example at wiki
>
page you gave, what if I want to remove some admins after I ran the recipe?
>
I modify the bag, and what's next? Is there a way to give a more declarative
>
semantics to things?
Chef doesn't provide any out-of-the-box policy enforcement features,
so it will not automatically remove something if you've removed it
from a recipe. You'll have to handle this on a case-by-case basis, but
in this case, you could move admins to a deleted admins databag and
handle it that way, or possibly determine which ones have been removed
by comparing etc/passwd with the databag. The Etc module could be
useful for this:
http://ruby-doc.org/stdlib/libdoc/etc/rdoc/classes/Etc.html
HTH,
Dan DeLeo
>
Best wishes,
>
Dmitry
>
Archive powered by MHonArc 2.6.16.