[chef] Re: RE: Re: How/can I update a node's attributes via knife WITHOUT bootstrapping


Chronological Thread 
  • From: Michel Blankleder < >
  • To:
  • Subject: [chef] Re: RE: Re: How/can I update a node's attributes via knife WITHOUT bootstrapping
  • Date: Mon, 11 May 2015 13:21:59 -0300

Hi,
I use knife exec to update attributes values.
Something like this:
knife exec -E 'nodes.find(:name => "node_name") {|n| n.set[attribute_name] = attribute_value ; n.save }
Hope it helps
Michel

On Mon, May 11, 2015 at 1:07 PM, Fouts, Chris < " target="_blank"> > wrote:

Thanks, I’ll look into these plugins.

 

Chris

 

From: Joe Nuspl [mailto: " target="_blank"> ]
Sent: Friday, May 08, 2015 3:03 PM
To: " target="_blank">
Subject: [chef] Re: How/can I update a node's attributes via knife WITHOUT bootstrapping

 

We wrote our own knife plugin a few years ago but since then several have popped up on github,  A quick search revealed:

 

 

This is by no means complete or an endorsement of any of these.

 

            Joe

 



I’m aware of the -j option to set node attributes during bootstrap. I’m also aware of knife edit, which is needs user input form an editor. This is NOT what I’m talking about

 

If a node is already bootstrapped, how can I set some of its attributes without re-bootstrapping it, and not using knife edit. I know I can do the following in a script since I want to do this automagically.

-        Knife ode show –Fj > node.json

-        Edit the node.json file

-        Knife node from file node.json

Is there a more elegant way?

 





Archive powered by MHonArc 2.6.16.

§