Details
Description
When attempting to create a node from a file:
nickh@MONITOR:~/Work/standingcloud/git/opscode-chef-repo$ knife node from file nodes/internal.repo.standingcloud.net.json ERROR: knife encountered an unexpected error This may be a bug in the 'node from file' knife command or plugin Please collect the output of this command with the `-VV` option before filing a bug report. Exception: NoMethodError: undefined method `save' for #<Hash:0x7fca9ad63500>
nickh@MONITOR:~/Work/standingcloud/git/opscode-chef-repo$ knife node from file nodes/internal.repo.standingcloud.net.json -VV
DEBUG: Using configuration from /home/nickh/Work/standingcloud/git/opscode-chef-repo/.chef/knife.rb
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/knife/node_from_file.rb:40:in `run': undefined method `save' for #<Hash:0x7f224ad3eb40> (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/knife.rb:391:in `run_with_pretty_exceptions'
from /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/knife.rb:166:in `run'
from /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/application/knife.rb:128:in `run'
from /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/knife:25
from /usr/bin/knife:19:in `load'
from /usr/bin/knife:19
It looks like I was missing some required things in my JSON...
Before (didn't work):
{ "normal": { "sc_backupServer": { "syncTo": "some.repo.standingcloud.net" } }, "name": "internal.repo.standingcloud.net", "chef_environment": "_default", "run_list": [ "role[sc_repoServer]", "role[sc_backupServer]" ], "chef_type": "node" }After (does work):
{ "normal": { "sc_backupServer": { "syncTo": "some.repo.standingcloud.net" } }, "name": "internal.repo.standingcloud.net", "override": { }, "default": { }, "json_class": "Chef::Node", "automatic": { }, "chef_environment": "_default", "run_list": [ "role[sc_repoServer]", "role[sc_backupServer]" ], "chef_type": "node" }Thanks