Edit attribute by chef API (ruby)


#1

Good day.

Can’t find out how to edit single attribute using chef api in ruby.

Someshing like:
chef_node = Chef::Node.load(fqdn)
chef_node.normal=(attr_name, new_value)

Thanks in advance.
Daniil.


#2

The attribute DSL in Chef is how Chef::Node objects work so you can use the same code you would in an attributes file. Then you just call node.save at the end.


Daniel DeLeo

On Tuesday, November 5, 2013 at 5:29 AM, Daniil S wrote:

Good day.

Can’t find out how to edit single attribute using chef api in ruby.

Someshing like:
chef_node = Chef::Node.load(fqdn)
chef_node.normal=(attr_name, new_value)


Thanks in advance.
Daniil.