cookbook 'chefenv_suffix', '~> 0.1.0'
chefenv_suffix (1) Versions 0.1.0 Follow1
Installs/Configures chefenv_suffix
cookbook 'chefenv_suffix', '~> 0.1.0', :supermarket
knife supermarket install chefenv_suffix
knife supermarket download chefenv_suffix
chefenv_suffix
Description
A simple library helper to return the suffix of a node's chef
environment.
Assuming that you use suffixed environments like foo-test
or
bar-prod
, the helper embedded in this cookbook provides a simple
way to return the test
or prod
part of the environment name.
Usage
Add the following line to your cookbook's metadata
depends 'chefenv_suffix', '~> 0.1'
In your recipe, when you need to use the suffix somewhere:
vaultitem = chef_vault_item('mysecrets', chefenv_suffix)
Attributes
The only attribute is node['chefenv_suffix']['pattern']
, which
defaults to
-?(\w+)$
And may be overridden to fix your needs. The pattern must have a
single capture group, which is the suffix the helper will return.
The default pattern is designed to match against environments
named using underscores, with a dash separator for the lifecycle
(test, prod, etc.):
foo-test
bar-prod
my_important_app-perf
The default pattern also returns _default if the node's environment
is not set.
Author
James FitzGibbon
License
Copyright (c) 2015 James FitzGibbon, All Rights Reserved.
Template
Generated from chef-gen-flavor 'nadt' v0.2.0
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Revision History for chefenv_suffix
0.1.0
- initial version
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
0.1.0 failed this metric
Contributing File Metric
0.1.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
0.1.0 failed this metric
Foodcritic Metric
0.1.0 passed this metric
0.1.0 passed this metric
No Binaries Metric
0.1.0 passed this metric
0.1.0 passed this metric
Testing File Metric
0.1.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
0.1.0 failed this metric
Version Tag Metric
0.1.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
0.1.0 failed this metric