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

attrbagger (2) Versions 0.2.0

Gets attributes from data bags.

Berkshelf/Librarian
Policyfile
Knife
cookbook 'attrbagger', '= 0.2.0'
cookbook 'attrbagger', '= 0.2.0', :supermarket
knife cookbook site install attrbagger
knife cookbook site download attrbagger
README
Dependencies
Quality -%

attrbagger Cookbook

Gets your attributes from your bags.

Somewhat fancy.

Auto-loading

Inclusion of recipe[attrbagger::default] will result in the keyspec_string => bag_cascade_string_array pairs specified in the node['attrbagger']['configs'] hash being walked and merged into the node's attribute precedence level specified via each hash's precedence_level attribute. An example role using attrbagger to load application-specific configuration from a base, custom, and dynamic environment-specific data bag, as well as loading mail service configuration might look like this:

name 'attrbagger_example'
description 'Attrbagger example role'

default_attributes(
  'deployment_env' => 'demo',
  'attrbagger' => {
    'configs' => {
      'example_app' => {
        'precedence_level' => 'override',
        'bag_cascade' => [
          'data_bag_item[applications::base::example_app]',
          'data_bag_item[applications::example_app]',
          "data_bag_item[applications::config_<%= node['deployment_env'] %>::example_app]"
        ]
      },
      'services::mail' => {
        'precedence_level' => 'default',
        'bag_cascade' => [
          'data_bag_item[services::mail]'
        ]
      }
    }
  },
  'example_app' => {
    'awesome' => true
  },
  'mail' => {
    'host' => 'localhost',
    'port' => 25
  }
)

run_list(
  'recipe[attrbagger]',
  # ... other stuff
)

This would result in the following actions:

  • Load data_bag_item('applications', 'base') and merge its example_app hash with node.default['example_app'], then assign the result to node.override['example_app']
  • Load data_bag_item('applications', 'example_app') and merge the entire data bag contents (except for builtin attributes like id and chef_type) with node.default['example_app'], then assign the result to node.override['example_app'].
  • Load data_bag_item('applications', 'config_demo') and merge its example_app hash with node.default['example_app'], then assign the result to node.override['example_app']
  • Load data_bag_item('services', 'mail') and merge the entire data bag contents (except for builtin attributes like id and chef_type) with node.default['services']['mail'], then assign the result to node.default['services']['mail'].

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found