Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/etsy/chef-whitelist
Simple library to enable host based rollouts of changes
https://github.com/etsy/chef-whitelist
non-sox
Last synced: 3 months ago
JSON representation
Simple library to enable host based rollouts of changes
- Host: GitHub
- URL: https://github.com/etsy/chef-whitelist
- Owner: etsy
- License: mit
- Archived: true
- Created: 2013-06-11T18:27:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T18:21:47.000Z (almost 9 years ago)
- Last Synced: 2024-07-04T22:57:09.100Z (4 months ago)
- Topics: non-sox
- Language: Ruby
- Homepage: http://codeascraft.com/2013/08/02/infrastructure-upgrades-with-chef/
- Size: 143 KB
- Stars: 68
- Watchers: 37
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-chef - Chef Whitelist - Simple library to enable host based rollouts of changes. (Add-ons / Resources - Application configuration)
README
Description
===========This library enables easy rollout of changes on a per host basis. The
whitelist is stored in a data bag and can contain single hostnames or roles.
Hostnames are checked first and can contain glob patterns to enable similarly
named hostgroups. If none of the hostnames match, all roles in the `roles`
array are checked whether the host has one of them applied.Requirements
============Attributes
==========Usage
=====First create a data bag item under the `whitelist` data bag and give it a
descriptive name. You don't have to use the `whitelist` data bag but the
library defaults to that name. Then add hosts and roles you want to enable for
the rollout:```
{
"id": "my_whitelist",
"patterns": [
"host.example.com",
"*.subdomain.example.com",
"prefix*.example.com"
]
}
```And the same example with the addition of roles:
```
{
"id": "my_whitelist",
"patterns": [
"host.example.com",
"*.subdomain.example.com",
"prefix*.example.com"
],
"roles": [
"Webserver",
"DatabaseServer"
]
}
```In your cookbooks you then have to add a dependency on the library cookbook in
`metadata.rb` like so:```
depends "chef-whitelist"
```Now all the recipes can branch depending on inclusion in a specific whitelist
with this simple statement:```
if node.is_in_whitelist? "my_whitelist"
# new hawtness
else
# old stuff
end
```If you don't use the default `whitelist` data bag and `patterns` key for
hostnames, you have to adapt the call to include the actual names:```
node.is_in_whitelist? "my_whitelist", "whitelist_databag", "hostnames"
```Contributing
=============- Fork the project
- Add your feature
- If you are adding new functionality, document it in the README
- Push the branch up to GitHub (bonus points for topic branches)
- Send a pull request to the etsy/chef-whitelist project.If you have questions, you can find us on IRC in the `#codeascraft` channel on Freenode.