Puppet Class: cron

Inherits:
cron::params
Defined in:
manifests/init.pp

Overview

Install & manage cron

Examples:

Declaring the class

include ::cron

Parameters:

  • package_name (String) (defaults to: $cron::params::package_name)

    the cron package to install

  • package_ensure (String) (defaults to: 'latest')

    the version of the cron package to install

  • service_name (String) (defaults to: $cron::params::service_name)

    the name of the cron service to manage

  • service_ensure (String) (defaults to: 'running')

    state of the cron service

  • crontab_file (String) (defaults to: $cron::params::crontab_file)

    path to the crontab file

  • crond_dir (String) (defaults to: $cron::params::crond_dir)

    path to the crond dir

  • crond_hourly (String) (defaults to: $cron::params::crond_hourly)

    path to the crond hourly scripts dir

  • crond_weekly (String) (defaults to: $cron::params::crond_weekly)

    path to the crond weekly scripts dir

  • crond_weekly (String) (defaults to: $cron::params::crond_weekly)

    path to the crond monthly scripts dir

  • user (String) (defaults to: $cron::params::user)

    username to own the cron directories and files

  • group (String) (defaults to: $cron::params::group)

    group to own the cron directories and files

  • purge (String) (defaults to: $cron::params::purge)

    whether to purge the contents of $crond_dir of resources not managed by Puppet

  • service_enable (Any) (defaults to: true)
  • crond_monthly (Any) (defaults to: $cron::params::crond_monthly)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/init.pp', line 18

class cron (
  $package_name   = $cron::params::package_name,
  $package_ensure = 'latest',
  $service_name   = $cron::params::service_name,
  $service_ensure = 'running',
  $service_enable = true,
  $crontab_file   = $cron::params::crontab_file,
  $crond_dir      = $cron::params::crond_dir,
  $crond_hourly   = $cron::params::crond_hourly,
  $crond_weekly   = $cron::params::crond_weekly,
  $crond_monthly  = $cron::params::crond_monthly,
  $user           = $cron::params::user,
  $group          = $cron::params::group,
  $purge          = $cron::params::purge,
) inherits cron::params {

  validate_re($service_ensure, '^(running|stopped)$')
  validate_bool($service_enable)

  anchor { 'cron_first': }
  ->
  class { 'cron::install': } ->
  class { 'cron::config': } ->
  class { 'cron::service': } ->
  anchor { 'cron_final': }

}