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

Select Status

RSS

chef_cleaner (2) Versions 1.0.1

This is small handler for clean directories from files not created by chef resources

Policyfile
Berkshelf
Knife
cookbook 'chef_cleaner', '= 1.0.1', :supermarket
cookbook 'chef_cleaner', '= 1.0.1'
knife supermarket install chef_cleaner
knife supermarket download chef_cleaner
README
Dependencies
Changelog
Quality 0%

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]"
  ]
}

make_clean resource

For starting cleaning in directory use make_clean 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

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (i.e. add-new-recipe)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. 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.

0.1.0

Initial release of chef_cleaner

  • Enhancements

    • an enhancement
  • Bug Fixes

    • a bug fix

Foodcritic Metric
            

1.0.1 failed this metric

FC017: LWRP does not notify when updated: /tmp/cook/eead9af470b7157b5c4f63ed/chef_cleaner/providers/default.rb:3
FC017: LWRP does not notify when updated: /tmp/cook/eead9af470b7157b5c4f63ed/chef_cleaner/providers/default.rb:7