- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Running resources & not_if { } qualifier
- Date: Thu, 2 Dec 2010 08:45:56 -0800
Ohai!
On Thu, Dec 2, 2010 at 7:56 AM, Ash Berlin
<
>
wrote:
>
On 2 Dec 2010, at 15:53, Dreamcat4 wrote:
>
> On Thu, Dec 2, 2010 at 3:20 PM, Ash Berlin
>
> <
>
>
> wrote:
>
>
>
> I also wonder if this is a bug in chef? Each time the array of actions
>
> is wiped out and overwritten. Isn't Chef meant to be smart enough to
>
> keep the existing actions when encountering new actions?
>
>
It's a feature. The most common use for this is when you have some
template where several recipes will need to add some content. Then you
do something like this:
# Recipe A
template "/etc/something" do
variables(Hash.new) if variables.nil?
variables[:foo] = "bar"
end
# Recipe B
template "/etc/something" do
variables(Hash.new) if variables.nil?
variables[:baz] = "qux"
end
It's definitely surprising when you first encounter it, though.
>
>
>
> dreamcat4
>
>
>
>
I think its that its not creating a new resource but augmenting the
>
existing one, so the second block is just changing the action for the first
>
one (and keeping the not_if) since they are both "rvm default_ruby"
>
resources.
>
Exactly.
>
-ash
Dan DeLeo
Archive powered by MHonArc 2.6.16.