Set an attribute on a node from the command line?


#1

Hi,

is there a better way than this…

knife exec -E “nodes.find(:name => ‘$(hostname)’) {|n|
n.set[‘someattribute’] = [‘somevalue’] ; n.save }”

Cheers
Tom


#2

I created a knife plugin for such kind of things

$ knife node exec [nodename] ‘node.set[:somefalue] = true’

–max

On Fri, Sep 14, 2012 at 9:11 PM, Tom Hodder tom@limepepper.co.uk wrote:

Hi,

is there a better way than this…

knife exec -E “nodes.find(:name => ‘$(hostname)’) {|n|
n.set[‘someattribute’] = [‘somevalue’] ; n.save }”

Cheers
Tom