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

RSS

logrotate-s3 (2) Versions 0.1.0

Installs/Configures Logrotate to move files to S3

Berkshelf
Policyfile
Knife
cookbook 'logrotate-s3', '= 0.1.0'
cookbook 'logrotate-s3', '= 0.1.0', :supermarket
knife supermarket install logrotate-s3
knife supermarket download logrotate-s3
README
Dependencies
Quality 63%

Build Status

Cookbook logrotate-s3

This cookbook offers two custom resources that can be used to configure S3 access, and then setup log rotation for any number of log files.

logrotate

Installs S3 upload script, and offers reusable resource for adding logs to the rotate schedule.

This cookbook uses package s3cmd to actually upload gzipped log files that have been rotated by logrotate.

Usage

First we must configure s3cmd so that it has access to S3:

logrotate_s3_config

logrotate_s3_config '/etc/logrotate-s3.conf' do
  s3_aws_region 'us-east-2'
  s3_access_key 'AFLKJLKJIERFKFJKDJFKDJ'
  s3_secret_key 'fjf09f9gf80ds8fg09f8gdfsg789sdf7'
end

logrotate_s3_file

Once configuration is in place, here is how you can wrap a log files produced by nginx in a proper rotation schedule, with upload of the gzipped files to S3.

logrotate_s3_file 'nginx' do
  s3_config '/etc/logrotate-s3.conf'
  log_dir '/var/log/nginx'
  rotate 5
  s3_bucket 'rotated-logs'
  upload_to_s3 true
end

Note that the actual location on S3 will be constructed as

  s3//{{ s3_bucket }}/{{ s3_folder or chef environment }}/nginx/logfile.gz

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kigster/cookbook-logrotate-s3.

License

© 2018 Konstantin Gredeskoul, All rights reserved. MIT License.

Acknowledgements

  • Jordan Brown @ Homebase

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

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.

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

Foodcritic Metric
            

0.1.0 passed this metric

No Binaries Metric
            

0.1.0 passed this metric

Publish Metric
            

0.1.0 passed this metric

Supported Platforms 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

Version Tag Metric
            

0.1.0 passed this metric