How to force convergence without bootstrapping?


#1

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#2

On Oct 14, 2014, at 5:07 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

I think you mean “without running knife bootstrap”? If so, then yes, just run sudo chef-client. All knife bootstrap does is 1) install Chef 2) copy over some config files and 3) run chef-client.

–Noah


#3

Assuming you’ve bootstrapped the node already and assigned it a role, you simply run chef client.

-----Original Message-----
From: Fouts, Chris [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#4

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:Dang.Nguyen@disney.com]
Sent: Tuesday, October 14, 2014 8:12 PM
To: chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?
Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#5

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 “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:Dang.Nguyen@disney.com]
SENT: Tuesday, October 14, 2014 8:12 PM
TO: chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
RECEIVED: Tuesday, 14 Oct 2014, 5:08PM
TO: chef@lists.opscode.com [chef@lists.opscode.com]
SUBJECT: [chef] How to force convergence without bootstrapping?

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#6

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:tensibai@iabis.net]
Sent: Wednesday, October 15, 2014 10:45 AM
To: chef@lists.opscode.com
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:Dang.Nguyen@disney.com]
Sent: Tuesday, October 14, 2014 8:12 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?
Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#7

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 Chris.Fouts@Sensus.com 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:tensibai@iabis.net]
Sent: Wednesday, October 15, 2014 10:45 AM
To: chef@lists.opscode.com
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:Dang.Nguyen@disney.com]
Sent: Tuesday, October 14, 2014 8:12 PM
To: chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris


#8

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 noah@coderanger.net
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 Chris.Fouts@Sensus.com 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:tensibai@iabis.net]
Sent: Wednesday, October 15, 2014 10:45 AM
To: chef@lists.opscode.com
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:Dang.Nguyen@disney.com]
Sent: Tuesday, October 14, 2014 8:12 PM
To: chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?

Is there a way to “force” my cookbooks to rerun without bootstrapping my
nodes?

Chris


#9

Yes thank you.

-----Original Message-----
From: Noah Kantrowitz [mailto:noah@coderanger.net]
Sent: Wednesday, October 15, 2014 11:21 AM
To: chef@lists.opscode.com
Subject: [chef] Re: How to force convergence without bootstrapping?

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 Chris.Fouts@Sensus.com 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:tensibai@iabis.net]
Sent: Wednesday, October 15, 2014 10:45 AM
To: chef@lists.opscode.com
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:Dang.Nguyen@disney.com]
Sent: Tuesday, October 14, 2014 8:12 PM
To: chef@lists.opscode.com
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 [Chris.Fouts@Sensus.com]
Received: Tuesday, 14 Oct 2014, 5:08PM
To: chef@lists.opscode.com [chef@lists.opscode.com]
Subject: [chef] How to force convergence without bootstrapping?

Is there a way to “force” my cookbooks to rerun without bootstrapping my nodes?

Chris