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

cronner (11) Versions 1.0.0

Installs/Configures cronner

Policyfile
Berkshelf
Knife
cookbook 'cronner', '~> 1.0.0', :supermarket
cookbook 'cronner', '~> 1.0.0'
knife supermarket install cronner
knife supermarket download cronner
README
Dependencies
Changelog
Quality 33%

cronner

Cookbook Version
ci

The cronner cookbook installs cronner
and provides a custom resource for configuring cron jobs that are wrapped with cronner.
The resource is a wrapper of the cron_d resource and injects the cronner invocation
before your command allowing the status and metrics to be collected.

Recipe Usage

This cookbook intends to try and track all major versions of the cronner
binary, to make it easy to switch between versions just with an attribute
change. By default this cookbook uses the latest version if one is not specified
otherwise. To install cronner, just execute the cronner::default recipe by
including it one of your recipes or by adding it to the run_list.

Recipe Attributes

This cookbook only has one attribute to impact the installation
(node['cronner']['default_install_version']), which takes the cronner version
string (e.g., 0.4.2) that you want to have installed.

Resource Usage

The cronner cookbook provides a custom resource to install cron jobs that are monitored
by cronner. This resource is a light wrapper around the stellar cron_d resource, originally from
the cron cookbook, but now included with Chef. That means the
cronner resource has all the same attributes available as the cron_d resource. For
information on the cron_d resource please see the documentation.

cronner 'db_backup' do
  command 'pg_dump ...'
  minute '0'
  hour '23'
  user 'postgres'

  # cronner is meant to replace the usage of mailto to alert you of errors or problems
  # however, it's a good idea to still set it if cronner were to hit its own internal issues
  # this actually happened in an early version of cronner where it would randomly hit a stdlib bug
  mailto 'ops@example.com'

  event true
  lock true
  log_fail true
  event_group 'db_operations'
  metric_group 'db_operations'

  warn_after 60 * 30 # (30 minutes)
  wait_secs_for_lock 60

  action :create # default action
end

Cronner Custom Resource Attributes

The custom resource supports either :create or :delete.

Attribute Description Default
event Tell cronner to emit an event on job start/stop false
event_fail Tell cronner to emit an event only on job failure false
log_fail Tell cronner to log a file on disk with the command output on failure only false
lock Tell cronner to take a exclusive file lock before running the job false
event_group The group tag to add to the events emitted nil
metric_group The group tag to add to the metrics emitted nil
label The label (name) of the cron job, used for metrics and events resource_name
namespace The namespace to emit metrics under, the binary uses 'cronner' if this is omitted nil
passthru Attach the output of the command to the controlling TTY false
use_parent Tag the events and metrics with the parameters provided by the parent invocation of cronner false
sensitive_output This tells cronner to try and avoid printing the output of the command because it may contain sensitive data false
warn_after Number of seconds to let cronner run a job before it emits a warning that it's running too long 0 (disabled)
wait_secs_for_lock Tells cronner how long it should wait for the exclusive lock before bailing out 0 (disabled)

License

This cookbook is licensed under the Apache 2.0 License. Please refer to
the LICENSE
file for the full contents of the license.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

cronner CHANGELOG

This file is used to list changes made in each version of the example cookbook.

1.0.0

Changed

  • Convert LWRP → Custom Resource & update for Chef >= 14 compatibility
  • Use built-in cron_d resource from Chef >= 14.4.0
    • Drop test assertions covered by the cron_d resource’s own testing
  • Rename cronner::installcronner::default to simplify things
  • Update metadata per current standards
  • Swap Policyfile for Berksfile
    • Six of one, but it’s what @jeffbyrnes is more familiar with & he did this refactor so 🤷
  • Simplify testing using kitchen-dokken

Added

  • Add ChefSpec tests
  • Use community cookbook Delivery config
  • Add testing using Chef 16

Fixed

  • Satisfy cookstyle

0.3.4

  • install cronner v0.6.1 by default

0.3.3

  • make sure the predefined_value property is passed to the cron_d resource

0.3.2

  • When invoking the cronner LWRP with action :create, always make sure to include the cronner::default recipe. Otherwise, the cronner binary may not be installed.

0.3.1

  • update README.md to include information about the passthru and use_parent properties

0.3.0

  • install cronner v0.5.0 by default
  • add support for --passthru and --use-parent flags

0.2.4

  • fix issue with invalid flags being rendered

0.2.3

  • fix source and issues URL in the metadata
  • remove unnecessary format_string() call

0.2.2

  • increase default cronner version from 0.4.1 to 0.4.2

0.2.1

  • add a detailed README file for the supermarket

0.2.0

  • add cronner LWRP which wraps the cron_d LWRP but uses cronner to run the command

0.1.0

Initial release.

  • support installation of cronner to /usr/local/bin

Collaborator Number Metric
            

1.0.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

1.0.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
            

1.0.0 passed this metric

No Binaries Metric
            

1.0.0 passed this metric

Testing File Metric
            

1.0.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
            

1.0.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 include a tag that matches this cookbook version number