[chef] JSON versus ARRAY


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] JSON versus ARRAY
  • Date: Thu, 6 Dec 2012 04:12:30 -0800 (PST)

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.

§