[chef] Re: Re: Data bags as JSON files in subdirectory structure


Chronological Thread 
  • From: Russell Bateman < >
  • To:
  • Subject: [chef] Re: Re: Data bags as JSON files in subdirectory structure
  • Date: Mon, 23 Sep 2013 19:39:01 -0600

Thank you, Daniel!


On 09/23/2013 07:15 PM, Daniel DeLeo wrote:
" type="cite">

On Monday, September 23, 2013 at 3:20 PM, Russell Bateman wrote:

I'm a little confused by the examples I see of data bags, in http://docs.opscode.com/essentials_data_bags.html and elsewhere.

I keep all my Chef stuff in a filesystem (and Git) thus:
cookbooks
nodes
roles

This has all be working very well. Growing up to be man in Chef and learning data bags, I plan to add to this
data_bags
    admins
        charlie.json
...and not
data_bags
    _admins
        _charlie.json


I see some mention of substructure in the doc, but it's confusing; sometimes subdirectories and filenames are prefixed with an underscore while there's no mention of it in the outer discussion, such as the following command, but I wish to avoid underscores unless significant or best practice. Examples of telling my Chef server about this data bag tend to suggest using
knife data bag from file admins data_bags/admins/charlie.json

This is the path in my filesystem, which I commit to Git. Am I missing something here?

Many thanks!
Looks like it's a doc bug. I haven't seen anyone use underscores for data bag/item names anywhere and it's certainly not a requirement. Some people advocate using leading underscores to indicate that things like recipes are "private" (i.e., you shouldn't put it in a run_list or call include_recipe) but off the top of my head I'm not even sure what it means for a data bag to be "private".

I'll ping our doc writer about this.

-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§