[chef] Re: Re: How to force convergence without bootstrapping?


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Re: Re: How to force convergence without bootstrapping?
  • Date: Wed, 15 Oct 2014 08:23:49 -0700

It's not that there's no way to do what you want. It's that there's no _need_ to do what you want. A chef-client run will (or should, unless you've got bad code that's not idempotent) result in the same state every time absent any changes in chef. Nuke the node, re-bootstrap, it won't matter; it will still compare the current state to the desired state and enforce the desired state.

Essentially, what you're asking for is already done natively, it's just smart enough to skip steps as needed when the current state already matches the desired state.

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Wed, Oct 15, 2014 at 8:20 AM, Noah Kantrowitz < " target="_blank"> > wrote:
It is more that what you are asking isn't a thing. It runs convergently so there is no need for a "force" option. If anything is out of line with the recipe code, Chef will fix it the second time, otherwise it leaves things as is. This is a property called idempotence.

--Noah

On Oct 15, 2014, at 8:09 AM, Fouts, Chris < > wrote:

> Fair enough, that’s all I wanted to know – that is – no there is NO way to do what I want.
>
> Chris
>
> From: Tensibai [mailto: "> ]
> Sent: Wednesday, October 15, 2014 10:45 AM
> To: ">
> Subject: [chef] Re: RE: RE: How to force convergence without bootstrapping?
>
> I'm unsure to understand what you want.
>
> The idea behind is that the cookbook is idempotent, doing things only if they need to be done.
>
> On each run each resource will ensure the resulting state is the desired state in the cookbook.
>
> There's no "Force" option, as it is the way it works, if a file managed with a template do not match the rendered template it will be replaced.
>
> So the only way would be undoing manually all the changes done in the first run. (or writing a cookbook undoing what is done on the run list.
>
> Re running the chef-client will redo what was done at first time if needed (i.e. someone has changed by hand a configuration somewhere which is managed by chef)
>
> Hope it helps, but still unsure on what you want at all...
>
> Regards
>
> Le 2014-10-15 16:21, Fouts, Chris a écrit :
>
> Sorry, let me ask it differently.
>
> I do the following
> 1.      knife bootstrap a node
>
> 2.      knife node run_list add <node> “run_list”
>
> 3.      chef-client on node, which converges the cookbooks
>
>
> Normally, re-running chef-client on the node again will not do anything since the cookbooks have already run the first time, meaning I’ll just get an “up-to-date” message
>
> My question is, how can I re-run chef-client to make it “act” like I have not done step 3 above the first time?
>
> Chris
>
>
> From: Nguyen, Dang [mailto: "> ]
> Sent: Tuesday, October 14, 2014 8:12 PM
> To: ">
> Subject: [chef] RE: How to force convergence without bootstrapping?
>
> Assuming you've bootstrapped the node already and assigned it a role, you simply run chef client.
>
> -----Original Message-----
> From: Fouts, Chris
> Received: Tuesday, 14 Oct 2014, 5:08PM
> To: "> [ "> ]
> Subject: [chef] How to force convergence without bootstrapping?
>
> Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?
>
> Chris





Archive powered by MHonArc 2.6.16.

§