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

windows_logrotate (4) Versions 0.1.0

Installs/Configures LogRotate for Windows

Policyfile
Berkshelf
Knife
cookbook 'windows_logrotate', '= 0.1.0', :supermarket
cookbook 'windows_logrotate', '= 0.1.0'
knife supermarket install windows_logrotate
knife supermarket download windows_logrotate
README
Dependencies
Changelog
Quality 71%

Windows LogRotate Cookbook

Cookbook Version
Build Status

Installs/configures Ken Salter's
LogRotate for Windows.

This is a Windows implementation of the logrotate utility found in
Linux platforms.

Supported logrotate configuration options:
https://sourceforge.net/p/logrotatewin/wiki/LogRotate/#configuration-file

Requirements

  • Chef 12.6+
  • .NET Framework v4.5

Platform

  • Windows

Usage

Use windows_logrotate resource to install and configure logrotate, and
create a scheduled task to run it periodically.

Example

windows_logrotate 'logrotate test' do
  username user
  password pass
  run_immediately true
  sensitive false
  conf <<-EOF
C:\\test.log {
    missingok
    compress
    delaycompress
    copytruncate
    notifempty
    rotate 5
    daily
    prerotate
        @echo off
        echo This is a test
        echo parameter pass %1
        VER | TIME > TEMP.BAT
        ECHO SET TIME=%%3>CURRENT.BAT
        DEL TEMP.BAT
        DEL CURRENT.BAT
        ECHO It's %TIME% now
    endscript
}
  EOF
end

Attributes

  • name - The name of logrotate configuration file to create. Defaults to resource block name.
  • username - The username to create scheduled task as. Default: Administrator.
  • password - Required to create scheduled task.
  • conf - Required logroate configuration.
  • verbose - Turns on verbose mode. Sensitive will need to be false in order to see output.
  • force - Tells logrotate to force the rotation, even if it doesn't think this is necessary. Sometimes this is useful after adding new entries to a logrotate config file, or if old log files have been removed by hand, as the new files will be created, and logging will continue correctly.
  • run_immediately - Runs scheduled task immediately after creating or updating logrotate configuration.
  • cookbook - The cookbook that contains the template for logrotate conf. Users can provide their own template by setting this attribute to point at a different cookbook. Default: windows_logrotate.
  • conf_tmpl - Sets the conf template source. Default: logrotate.conf.erb.
  • schtask_tmpl - Sets the schtask template source. Default: schtask.xml.erb.
  • sensitive - Suppress logging sensitive information. Default: true.

ChefSpec Matchers

This cookbook includes custom
ChefSpec matchers you can
use to test your own cookbooks.

Example Matcher Usage

expect(chef_run).to enable_windows_logrotate('resource_name')

Cookbook Matchers

  • enable_windows_logrotate(resource_name)

Getting Help

Contributing

Please refer to
CONTRIBUTING.

License

MIT - see the accompanying
LICENSE
file for details.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

CHANGELOG

0.1.0 2017-01-20

  • Initial release using logrotateSetup v0.0.0.17

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 passed this metric

Foodcritic Metric
            

0.1.0 passed this metric

License Metric
            

0.1.0 passed this metric

No Binaries 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