[chef] Re: Re: Re: Re: Re: node.save?


Chronological Thread 
  • From: Klaas Jan Wierenga < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: node.save?
  • Date: Fri, 9 Sep 2011 16:27:23 +0200

Hi,

node.save is used explicitly when information must be save even if the chef run fails.

A good example is when a random password (e.g. for MySQL) has been generated and applied to the database. If you don't call node.save and the run fails, then the next run will generate a new password which doesn't match the password in the database so access to the database will fail.

By calling node.save right after generating the password but before applying it to the database you ensure that even when the chef run fails lateron, the same password will be used in subsequent chef runs.

Regards,

Klaas Jan Wierenga

2011/9/9 Denis Barishev < "> >
On 09/09/2011 03:55 PM, Ranjib Dey wrote:
node.save is not invoked if the run fails, but i guess we can hack it inside a report handler and save it there.


Okay good. But I think we'd better explicitly call node.save inside a recipe (as others do it) if we expect fails latter in recipe... It's not good a good practice to persist data of a node failed to run.

Denis




--
Groeten,

Klaas Jan
">




Archive powered by MHonArc 2.6.16.

§