[chef] Re: Need default attribute list of a cookbook using api


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Need default attribute list of a cookbook using api
  • Date: Fri, 6 Sep 2013 14:34:08 -0700


On Thursday, September 5, 2013 at 12:19 AM, wrote:


Hi,

Is there a way to get the default cookbook attributes using chef-api . So that
i can override them pragmatically later on .

I used knife to fetch cookbook metadata in json format , but that only list
the attribute file.

"attributes": [
{
"name": "default.rb",
"path": "attributes/default.rb",
"checksum": "f9cc6b7d7075cf91e012e00e0f4ff796",
"specificity": "default",
"url": "https://---D"
}

thanks
jagadeesh
This isn't _really_ possible. If the metadata file correctly documents the attributes, you can get that from the API, but there's no guarantee that this information is complete or up-to-date. The source of truth is the attributes file, which is ruby code. If the cookbooks you're interested in are simple enough, you could maybe hack something together to fetch the attributes files and figure out the attributes that way.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§