[chef] Re: JSON versus ARRAY


Chronological Thread 
  • From: Ulises Ramirez-Roche < >
  • To: " " < >
  • Subject: [chef] Re: JSON versus ARRAY
  • Date: Thu, 6 Dec 2012 08:11:45 -0500

They're both hashes(key-value pairs), only in different languages. Use 
whatever you like. Attributes, however, are resolved by precedence, so where 
you put them matters. Wiki has more details.

Sent from my iPhone

On Dec 6, 2012, at 7:12 AM, 
< >
 wrote:

> The site cookbook for mongodb has the following snippet of code in the 
> readme
> file:
> 
> <quote>
> Most importantly you need to define what collections should be sharded by
> setting the attribute mongodb[:sharded_collections]:
> {
>  "mongodb": {
>    "sharded_collections": {
>      "test.addressbook": "name",
>      "mydatabase.calendar": "date"
>    }
>  }
> }
> </quote>
> 
> Actually, I added this into my recipe via the attributes file using a 
> different
> format:
> 
> default[:mongodb][:sharded_collections]["test4.addressbook"] = "name"
> default[:mongodb][:sharded_collections]["mydatabase.calendar"] = "date"
> 
> That methodology seemed to make more sense.  To add this into the attributes
> file in that format.  They are attributes, after all.
> 
> My question to the mailing list, what would you consider the standard and
> recommended way to apply these attributes?  Would you use JSON or an ARRAY,
> which file would you place them in, and how would you get them uploaded into
> chef.      Not what is "possible", but rather "what is best practice".
> 
> Thanks.



Archive powered by MHonArc 2.6.16.

§