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

overridable (1) Versions 0.2.0

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

Berkshelf/Librarian
Policyfile
Knife
cookbook 'overridable', '~> 0.2.0'
cookbook 'overridable', '~> 0.2.0', :supermarket
knife cookbook site install overridable
knife cookbook site download overridable
README
Dependencies
Quality

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
FC017: LWRP does not notify when updated: overridable/providers/template.rb:11
FC017: LWRP does not notify when updated: overridable/providers/template.rb:15
FC017: LWRP does not notify when updated: overridable/providers/template.rb:68
FC059: LWRP provider does not declare use_inline_resources: overridable/providers/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 11.1.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.2.0 passed this metric

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

overridable 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