Hi,
I was wondering if anyone has an idea how to decently change a single attribute
of a node when that attribute is passed on the command line as an argument for
a knife plugin.
Let's say the plugin's name is 'node set_attr'
E.g. if I run
knife node set_attr NODENAME apache.dir "/tmp"
I want to achieve that node['apache']['dir'] == "/tmp".
The only way I came up with is something along the lines of:
= @name_args[0]
= @name_args[1]
= @name_args[2]
= Chef::Node.load(@nodename)
ruby_command = "@node." + @attribute + "=" + @new_value
eval(ruby_command)
Archive powered by MHonArc 2.6.16.