[chef] Re: node.save?


Chronological Thread 
  • From: Joshua Timberman < >
  • To:
  • Subject: [chef] Re: node.save?
  • Date: Sat, 10 Sep 2011 19:24:37 -0600

I believe the conversation following answers the primary part of the query.

An unanswered question may be "So why doesn't Chef save the node when
the run fails?"

The answer is, that by default, Chef would have no way of knowing
whether that is a desirable thing to do. There may be something in
your recipes that you wouldn't want saved until the full convergence
finished. Chef doesn't make the assumption of doing so because it is
easier for you to explicitly save in a recipe, or to call node.save in
a report / exception handler than to try and undo that kind of
behavior down in the core of Chef.

And to clarify, the attribute behavior in the mysql::server recipe is
specifically because we're generating a random password so there's
*something* to use in preseeding the mysql installation, AND so the
password is persisted as an attribute, so you don't have to do
additional work in setting a password somewhere to use it.

Hope this helps.

On Fri, Sep 9, 2011 at 4:46 AM, Denis Barishev 
< >
 wrote:
> Hey all,
>
> How do you think why we meet the node.save command in many recipes? For
> example, I've seen it in the mysql recipe.
> As far as I understand any attributes that are set in recipes are
> automatically persisted.
> So what for is the 'node.save' command then?
>
> Thanks for any ideas
>
> Denis
>
>



-- 
Opscode, Inc
Joshua Timberman, Director of Training and Services
IRC, Skype, Twitter, Github: jtimberman



Archive powered by MHonArc 2.6.16.

§