Puppet Function: cron::prep4cron

Defined in:
functions/prep4cron.pp
Function type:
Puppet Language

Overview

cron::prep4cron(Variant[Cron::Minute, Cron::Hour, Cron::Monthday, Cron::Month, Cron::Weekday] $cron_value = '*')String, ...

This functions prepares any cron::job custom timing value to be used as Puppet internal cron’s resource argument

Parameters:

  • cron_value (Variant[Cron::Minute, Cron::Hour, Cron::Monthday, Cron::Month, Cron::Weekday]) (defaults to: '*')

    A variant of any of cron’s internal timing structures (minute, hour, monthday, month, weekday)

Returns:

  • (String, Integer, Array[Variant[Integer, String]])

    Representation of the cron time value in a proper format suited for internal Puppet’s cron resource.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'functions/prep4cron.pp', line 7

function cron::prep4cron (
  Variant[Cron::Minute, Cron::Hour, Cron::Monthday, Cron::Month, Cron::Weekday] $cron_value = '*',
) {

  if $cron_value.is_a(Array) {

    unique($cron_value)

  } else {

    $cron_value

  }

}