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

alphard-cron (3) Versions 1.0.0

Installs/Configures and Provides helpers definitions for cron

Policyfile
Berkshelf
Knife
cookbook 'alphard-cron', '= 1.0.0', :supermarket
cookbook 'alphard-cron', '= 1.0.0'
knife supermarket install alphard-cron
knife supermarket download alphard-cron
README
Dependencies
Quality 0%

alphard-cron Cookbook

This cookbook provides a recipe to update cron and schedule service restart

Requirements

  • Ubuntu 14.04

Chef

  • Chef 12.0 or later

Attributes

alphard-cron::default

General

  • ['alphard']['cron]['user'] - the user used to add crontab entries and create log file and directory
  • ['alphard']['cron]['group'] - the user used create log file and directory
  • ['alphard']['cron]['version'] - the cron ubuntu version

Cron Tab

  • ['alphard']['cron]['tab'][my_service] - the service name you want to restart periodically (the restart command will be: 'service my_service restart')
  • ['alphard']['cron]['tab'][my_service][expression] - the cron expression
  • ['alphard']['cron]['tab'][my_service][minute] - the cron expression minute value
  • ['alphard']['cron]['tab'][my_service][hour] - the cron expression hour value
  • ['alphard']['cron]['tab'][my_service][weekday] - the cron expression weekday value
  • ['alphard']['cron]['tab'][my_service][day] - the cron expression day value
  • ['alphard']['cron]['tab'][my_service][month] - the cron expression month value
  • ['alphard']['cron]['tab'][my_service][randomized] - default false, if true the service will be restart with the specified delay. Useful fo distributed env and you don't want to restart services at the same time on each machine
  • ['alphard']['cron]['tab'][my_service][delay] - the cron maximum delay before restart in seconds
  • ['alphard']['cron]['tab'][my_service][enabled] - if true the cron entry will be added to the cron tab, if false the entry will be removed from cron tab

Usage

alphard-cron::default

Include alphard-cron in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[alphard-cron]"
  ]
}

Add attributes for each service you want to restart periodically

default['alphard']['cron']['tab']['cron']['expression'] = '* * * * *'
default['alphard']['cron']['tab']['cron']['randomized'] = true
default['alphard']['cron']['tab']['cron']['delay'] = 60
default['alphard']['cron']['tab']['cron']['enabled'] = true

License

Copyright 2009-2016, Hydra Technologies, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Authors

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Foodcritic Metric
            

1.0.0 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:72
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:73
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:80
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:81
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:88
FC015: Consider converting definition to a LWRP: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/definitions/cron_restart.rb:1
FC019: Access node attributes in a consistent manner: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/attributes/default.rb:21
FC019: Access node attributes in a consistent manner: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/attributes/default.rb:22
FC019: Access node attributes in a consistent manner: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/attributes/default.rb:23
FC019: Access node attributes in a consistent manner: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/recipes/default.rb:22
FC019: Access node attributes in a consistent manner: /tmp/cook/022ab2d30a56d10f000436e2/alphard-cron/recipes/default.rb:26