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

Select Status

RSS

summary_handlers (3) Versions 0.2.5

Installs/Configures some handlers that summerise the Chef run in terms of Resource and Recipe

Policyfile
Berkshelf
Knife
cookbook 'summary_handlers', '= 0.2.5', :supermarket
cookbook 'summary_handlers', '= 0.2.5'
knife supermarket install summary_handlers
knife supermarket download summary_handlers
README
Dependencies
Changelog
Quality 100%

summary-handlers Cookbook

This cookbook includes three report handlers.

Cookbook Summary

The cookbook summary is a list of cookbooks that have been pulled down as part of the run list (or dependencies).

Recipe Summary

The recipe summary is designed for situations for helping to see if a community cookbook has been added as a dependency but no longer required as it lists all recipes and marks those that have not been loaded.

Resource Summary

The resource summary is for larger cookbooks with a lot of resources to summerise the resources that have been loaded into the resource queue. The report has two modes, output the resources grouped by type or by cookbook recipe.
There are two sorting options
* By Type; the output is resource type followed by recipe name
* By Cookbook; the output is recipe name followed by resources

The overall intention of the summary handlers is for development time using Test Kitchen, not production but it could be added as part of a regular run list.

Output is using puts rather than Chef::Log, if you fork and change the code to use Chef::Log and there is no output check your Log level!

If the cookbook proves to be popular I will distribute the core as a gem to make it even easier to install and use!

Requirements

Tested with ChefDK 0.62

Attributes

summary-handlers::default

Key Type Description Default
['summary-handlers']['cookbook-summary-report'] boolean If default recipe called add cookbook-summary true
['summary-handlers']['recipe-summary-report'] boolean If default recipe called add recipe-summary true
['summary-handlers']['resource-summary-report'] boolean If default recipe called add resource-summary true

summary-handlers::resource_summary

NB: Key is abbreviated, the key path starts with ['summary-handlers']['resource-summary']
Simple add below for full attribute name, i.e ['summary-handlers']['resource-summary']['report_type']

Key Type Description Default
['report_type'] Symbol :by_cookbook or :by_type :by_cookbook
['report_format'] Symbol :template, :json or :yaml :template
['updated_only'] boolean Show only updated resources false
['user_filter'] Proc Proc for user filter nil

The user_filter will allow you to filter resource summary to just the resources you are interested in, the filter can be any valid resouce property.

Example setting for
default['summary-handlers']['resource-summary']['user_filter'] = proc {|resource| resource.method == user_criteria}

This setting will need to be done in your wrapper cookbook attributes or recipe file as it requires Ruby proc.

Usage

If using Test Kitchen and Berkshelf then add to your Berksfile, summary_handlers is available on Git or Public Chef Supermarket.

Git

cookbook 'summary_handlers', git: 'https://github.com/chrisgit/chef-summary_handlers'

Public Supermarket
````
source 'https://supermarket.chef.io'

metadata

cookbook 'summary_handlers'
````

Change you test suite run list to include summary handlers (.kitchen.yml or .kitchen.local.yml)

suites:
- name: default
run_list: ["recipe[summary_handlers]","recipe[my_cookbook]"]
attributes: { ... }

Use the attributes section of the test suite to get the desired behavior.

Alternatively, you can add this cookbook as a dependency in your cookbook, to do that update your cookbooks metadata file

depends 'summary_handlers'

Then add an include_recipe in default.rb (or one of the recipes used by your cookbook)

include_recipe 'summary_handlers

Contributing

Branch the source, make the changes, add tests as appropriate, make a pull request.

License and Authors

Authors: Chris Sullivan

Dependent cookbooks

chef_handler >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

summary-handlers CHANGELOG

This file is used to list changes made in each version of the summary-handlers cookbook.

0.2.5

  • [Chris Sullivan] - Fix FC064 and FC065

0.2.4

  • [Chris Sullivan] - Remove Berksfile.lock

0.2.3

  • [Chris Sullivan] - Added updated only option for resource summary, refactored

0.2.2

  • [Chris Sullivan] - Cookbook report and refactoring of Recipe Summary

0.2.1

  • [Chris Sullivan] - Slight change in format of reports

0.2.0

  • [Chris Sullivan] - Simplify code and change format of reports

0.1.0

  • [Chris Sullivan] - Initial release of summary-handlers

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Foodcritic Metric
            

0.2.5 passed this metric