Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

data-bag-cache (3) Versions 0.2.0

Installs/Configures data-bag-cache

Berkshelf/Librarian
Policyfile
Knife
cookbook 'data-bag-cache', '~> 0.2.0'
cookbook 'data-bag-cache', '~> 0.2.0', :supermarket
knife cookbook site install data-bag-cache
knife cookbook site download data-bag-cache
README
Dependencies
Quality 33%

data-bag-cache

About

Description

Temporarily caches Chef data bag items in an attribute to speed up chef-client runs.

Author

Getting Started

Installation

Using Berkshelf: cookbook 'data-bag-cache', '~> 0.2.0'

Utilization

To use this cookbook, first ensure that you have added depends "data-bag-cache" to your metadata.rb. Once your cookbook is dependent on data-bag-cache you can cache data bag items using the data_bag_cache_items LWRP. The resources available to the LWRP are listed below:

  • name (required) - name and location of the cached data bag items (name attribute).
  • data_bag (optional) - name of the data bag. Defaults to name if not provided.
  • search (optional) - a custom search query which will be executed when getting data bag items. Defaults to nil.
  • cache_disabled (optional) - When true, calls to the data_bag_cache_items LWRP will bypass local cache, and will always perform a new search. Defaults to false.

To access cached data bag items, simply reference the node attribute storing the items. Your items will be located at node['data-bag-cache'][lwrp_name_attribute].

Examples

Get all items in the users data bag: ruby data_bag_cache "users"

Get all items in the users data bag where the sysadmin group is present: ruby data_bag_cache "users" do search "group:sysadmin" end

Get all items in the users data bag where the shell is /bin/zsh: ruby data_bag_cache "zsh_users" do data_bag "users" search "shell:/bin/zsh" end

Get all items in the users data bag, ensuring it is the most up to date list (not serving a cached copy from earlier in the run): ruby data_bag_cache "users" do cache_disabled true end

Iterating over all items in the users data bag: ruby node['data-bag-cache']['users'].each do |user| puts user.to_json end

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.2.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.2.0 failed this metric

FC039: Node method cannot be accessed with key: data-bag-cache/definitions/data_bag_cache.rb:55
FC064: Ensure issues_url is set in metadata: data-bag-cache/metadata.rb:1
FC065: Ensure source_url is set in metadata: data-bag-cache/metadata.rb:1
FC066: Ensure chef_version is set in metadata: data-bag-cache/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: data-bag-cache/metadata.rb:1
Run with Foodcritic Version 12.2.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.2.0 failed this metric

data-bag-cache does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.

No Binaries Metric
            

0.2.0 passed this metric

Publish Metric
            

0.2.0 passed this metric

Supported Platforms Metric
            

0.2.0 failed this metric

data-bag-cache should declare what platform(s) it supports.

Testing File Metric
            

0.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.2.0 passed this metric