Clear run list on node - knife command

Hi,

trying to work out the command to clear the run list of an existing node prior to updating with new one

I think this is the right direction but cannot get it to work - I assume anyone using Chef in a pipeline will already have this command working correctly ..

knife exec -E 'nodes.find(“name:SERVERNAME”) {|n| puts n.name; n.run_list.reset!; n.save}'

Any suggestions?

Thanks

David

David,

I'm not sure I understand your use case. Are you just trying to set the run list of a node to blank, or to change the list entirely?

In either case, 'knife node run_list set' will set a nodes run list to whatever you put there, replacing whatever was there before.

-Mobile Galen

I'll try the set command - thanks - was trying to update the runlist without having to remove the existing items first.

It worked ! :grin: many thanks @Galen_Emery1

Have a great weekend