cookbook 'gitlab-vault', '~> 0.2.0'
gitlab-vault (1) Versions 0.2.0 Follow1
Library for working with vault secrets
cookbook 'gitlab-vault', '~> 0.2.0', :supermarket
knife supermarket install gitlab-vault
knife supermarket download gitlab-vault
gitlab-vault
Merge node attributes with values from a Chef Vault item at run time.
Usage
Suppose your recipe's attributes are in node['my-cookbook']['my-recipe']
. You
want to store some of the attributes in a Chef Vault called 'my-vault' (with
item 'my-item' ) instead of in the node attributes. At the start of your
recipe, write:
include_recipe 'gitlab-vault'
my_recipe_conf = GitLab::Vault.get(node, 'my-cookbook', 'my-recipe')
You now have a hash my_recipe_conf
which you can use wherever you would
otherwise write node['my-cookbook']['my-recipe']
. At run time, this hash will
contain a mix of regular attributes and secrets.
In the Chef role applied to your nodes that should see the secrets, specify
which vault and vault item to use.
{
"my-cookbook": {
"my-recipe": {
"not_secret": "everybody is allowed to see this",
"chef_vault": "my-vault",
"chef_vault_item": "my-item"
}
}
In your Chef Vault item, you can just mirror the structure of your node
attributes. Note that the 'id' field is used by Chef Vault itself.
{
"id": "my-item",
"my-cookbook": {
"my-recipe": {
"secret": "need to know only"
}
}
}
Then at run time, the my_recipe_conf
hash will look like:
{
"my-cookbook": {
"my-recipe": {
"not_secret": "everybody is allowed to see this",
"secret": "need to know only",
"chef_vault": "my-vault",
"chef_vault_item": "my-item"
}
}
}
License and Authors
Author:: GitLab Inc. (jacob@gitlab.com, jeroen@gitlab.com)
MIT license
0.2.0
Refactor of gitlab-attributes-with-secrets
0.1.0
Initial release of gitlab-attributes-with-secrets
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 passed this metric
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
0.2.0 failed this 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 passed this metric
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
0.2.0 passed this 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
0.2.0 failed this 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