Puppet Function: pulp::daily_schedule

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

Overview

pulp::daily_schedule(String $seed)String

Examples:

Calling the function

pulp::daily_schedule('centos-7')

Parameters:

  • seed (String)

    A seed to pass to ‘fqdn_rand`. A good choice is the repo name that this schedule will be for.

Returns:

  • (String)

    Returns a ‘pseudo-random’ daily iso8601 schedule.



6
7
8
9
10
# File 'functions/daily_schedule.pp', line 6

function pulp::daily_schedule(String $seed) >> String {
  $random_hour   = sprintf('%02d', fqdn_rand(23, $seed))
  $random_minute = sprintf('%02d', fqdn_rand(59, $seed))
  "2000-01-01T${random_hour}:${random_minute}Z/P1D"
}