[chef] Re: Re: Re: chef-solo and override attributes will not work in json role


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: chef-solo and override attributes will not work in json role
  • Date: Thu, 16 Jan 2014 14:18:25 -0800


On Thursday, January 16, 2014 at 1:30 PM, David Montgomery wrote:

Then what do I do?  default_attributes?  will that work?

Kinda confused...why is the below in the docs?

http://docs.opscode.com/chef_solo.html


{
  "name": "test",
  "default_attributes": { },
  "override_attributes": { },
  "json_class": "Chef::Role",
  "description": "This is just a test role, no big deal.",
  "chef_type": "role",
  "run_list": [ "recipe[test]" ]
}


Sorry, I misread your original post, I thought you were trying to pass something like that in using -j JSON_FILE, which doesn’t work.

As far as I can tell from what you’ve posted, your example should work as long as your role is getting picked up in the run_list. You could try adding code like this to debug your attributes:

  require 'pp'
  pp node.debug_value(“environment")

You can also try running chef with debug logging to see if anything else looks odd.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§