Download entire databag?


#1

hello!

i am using data bags in such a way that an “admin” server creates about
3500 data bag items in a specific, then on each chef run verifies the
contents and deletes or adds missing or extra items.

i realize this is not the same way others would do it, but it is how i do
it.

what i’m wondering:

is there a way to download the entire data bag, rather than fetching each
item one by one? it works out to 3500 round trips, which adds up to a very
long chef run…

thanks!
-jesse


#2

You can use search. search(:mydatabag, “:”)

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


#3

Hmm. This could work. Back in the once upon a time that failed because
there was one big data bag item instead of 3500 tiny ones, and no matter
how the config was changed, solr refused to index it.

I’d prefer a direct call instead of a search, but this could work.

Could even use partial search when a node needs one attribute from each of
1800 of those. Hmm :slight_smile:
On Mar 12, 2013 6:36 PM, “Brian Akins” brian@akins.org wrote:

You can use search. search(:mydatabag, “:”)

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