[chef] Problem trying to override attributes for a node


Chronological Thread 
  • From: Antonio Fernández Vara < >
  • To:
  • Subject: [chef] Problem trying to override attributes for a node
  • Date: Thu, 16 Jan 2014 10:27:54 +0100

Hello all,

I must say that normally all our configuration remains in role and environment files but for a temporally solution.

We have several fronts that normally use a backend all of them, but this time we need to override this and every frontend must attack with just one server on the backend.

So I wrote this json (that I though could work, but I have a strange problem) that returns an strange error in knife:

staging-1.json 

{
  "name":"staging-1.public-staging",
  "override":
    {
      "nginx":
        {
          "upstreams":
            {
              "apache-front":
                {
                  "staging-front-1.staging.local:8080":
                    {
                      "weight":1
                    }
                }
            }
        }
    }
}


And the error returned by knife is this one:

knife node from file nodes/staging-ws-2.json -VV        
/home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/node.rb:429:in `json_create': undefined method `each' for nil:NilClass (NoMethodError)
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife/core/object_loader.rb:92:in `object_from_file'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife/core/object_loader.rb:42:in `load_from'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife/node_from_file.rb:38:in `run'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:466:in `run_with_pretty_exceptions'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:173:in `run'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/knife.rb:123:in `run'
from /home/antonio/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/chef-11.6.2/bin/knife:25:in `<top (required)>'
from /home/antonio/.rbenv/versions/1.9.3-p448/bin/knife:23:in `load'
from /home/antonio/.rbenv/versions/1.9.3-p448/bin/knife:23:in `<main>'



Hope someone can help me, I'm pretty lost. Thanks in advance.

Antonio




Archive powered by MHonArc 2.6.16.

§