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

overridable (1) Versions 0.2.0

A wrapper for the Template resource that provides more flexibility to cookbook users

Policyfile
Berkshelf
Knife
cookbook 'overridable', '~> 0.2.0', :supermarket
cookbook 'overridable', '~> 0.2.0'
knife supermarket install overridable
knife supermarket download overridable
README
Dependencies
Quality 17%

Description

The overridable cookbook provides an LWRP that makes it simple to provide
maximum user flexibility in cookbook templates. When used instead of the
standard Template resource (http://wiki.opscode.com/display/chef/Resources#Resources-Template),
it provides a means for a cookbook user to override each template with either
the user's own template or a concrete file.

Attributes

  • node['overridable']['template']['enabled'] - Default: true. Setting to false passes through to the standard Template behavior
  • node['overridable']['template']['files_enabled'] - Default: true. Setting to false disables the ability to override from files
  • node['overridable']['template']['templates_enabled'] - Default: true. Setting to false disables the ability to override existing templates with new templates

Usage

Cookbook Authors

To use the LWRP in your cookbook, simply add depends 'overridable' to the
cookbook's metadata.rb and substitute any template resources
with overridable_template

Cookbook Users

When config file customization is needed on a cookbook that takes advantage of
overridable template, two options are available:

Custom template

Copy the cookbook's provided template file to a new file of the same name
within the cookbook's templates/overrides directory.
Ex: templates/default/web_app.conf.erb maps to templates/default/overrides/web_app.conf.erb
Additional attributes can be set in a new attributes file added to the cookbook
attributes/ directory and referenced through the @node reference exposed to
the Erb template. File-specificity rules are honored, so the override/ path can
exist in a host-specific directory instead for instance.

Custom file

A file can replace the template behavior entirely (ensure you have dealt with
any dynamic aspect of the config you're replacing). The file must be named
the same as the destination path of the template resource
Ex: /etc/ntp.conf would be named ntp.conf within the cookbook's files/
directory

Todo

  • Multiple overridable_template calls that refer to the same base filename within separate paths will all be overridden by the same file with no way to separate them out
  • Given the name of the cookbook, other wrappers could make sense as well (file?)

License and Author

Author:: Michael Leinartas (mleinartas@gmail.com)

Copyright 2011, Michael Leinartas

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

FC016: LWRP does not declare a default action: overridable/resources/template.rb:1
FC064: Ensure issues_url is set in metadata: overridable/metadata.rb:1
FC065: Ensure source_url is set in metadata: overridable/metadata.rb:1
FC066: Ensure chef_version is set in metadata: overridable/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: overridable/metadata.rb:1
FC069: Ensure standardized license defined in metadata: overridable/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.2.0 passed this metric

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 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 include a tag that matches this cookbook version number