cookbook 'chef_cleaner', '~> 1.0.2'
chef_cleaner (2) Versions 1.0.2 Follow0
This is small handler for clean directories from files not created by chef resources
cookbook 'chef_cleaner', '~> 1.0.2', :supermarket
knife supermarket install chef_cleaner
knife supermarket download chef_cleaner
chef_cleaner
Simple chef handler to remove files who was not updated by chef in the specific directory.
Supported Platforms
Tested on Ubuntu 12.04, but may work on almost all linux platforms.
Usage
For init handler — include chef_cleaner into your run_list
Include chef_cleaner
in your node's run_list
:
{ "run_list": [ "recipe[chef_cleaner::default]" ] }
chef_cleaner resource
For starting cleaning in directory use chef_cleaner resource:
chef_cleaner "/tmp/1"
There is additional attributes:
* recursive - For recursive check files in dir. Default: false (TrueFalse)
* exclude - Array of exclude files in dir (May be Regexp or local path or global path) (String or Regexp or Array)
* report - for testing, if you not sure what you want to clean. Default: false (TrueFalse)
* notify - run some command if cleaner remove some files (String or Array)
Actions:
* :make_clean - Default action
* :report - Make report, not remove files
Examples:
chef_cleaner "/etc/sensu/conf.d/checks" do exclude "my_new_check.json" notify "\`service sensu-client restart\`" end
chef_cleaner "/etc/nginx/site-enables" do recursive true action :report end
chef_cleaner "Custom name" do directory "/tmp/test_directory_7" recursive true exclude [/.*regexp$/, "subdir_created_with_bash/created_with_bash", "/subdir_created_with_chef/created_with_bash", "/tmp/test_directory_7/subdir_created_with_bash/created_with_bash_other"] end
Testing
- Modify test.rb recipe
- Just run
vagrant up
Contributing
- Fork the repository on Github
- Create a named feature branch (i.e.
add-new-recipe
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
License and Authors
Author:: Grammarly, Inc. (ctrlok@gmail.com)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
1.0.2
Modify readme file and changelog
1.0.1
Remove chef_handler from depends. Opscode never merge our pull requests
1.0.0
Rewrite code, adding tests
- Enhancements
- adding tetst
0.1.0
Initial release of chef_cleaner
-
Enhancements
- an enhancement
-
Bug Fixes
- a bug fix
Collaborator Number Metric
1.0.2 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.2 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
1.0.2 failed this metric
FC064: Ensure issues_url is set in metadata: chef_cleaner/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef_cleaner/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_cleaner/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_cleaner/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 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
1.0.2 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
1.0.2 failed this metric
1.0.2 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
1.0.2 failed this metric
FC064: Ensure issues_url is set in metadata: chef_cleaner/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef_cleaner/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_cleaner/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_cleaner/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 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
1.0.2 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
1.0.2 failed this metric
FC065: Ensure source_url is set in metadata: chef_cleaner/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_cleaner/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_cleaner/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.2 passed this metric
Testing File Metric
1.0.2 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
1.0.2 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
1.0.2 failed this metric
1.0.2 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