Page MenuHomeSoftware Heritage

cron_rand.pp
No OneTemporary

cron_rand.pp

# Randomize a cron run
function profile::cron_rand (
Hash[Enum['minute', 'hour', 'month', 'monthday', 'weekday'], Variant[Integer, String, Undef]] $data,
String $seed,
) {
$maxima = {
'minute' => 60,
'hour' => 24,
'month' => 12,
'monthday' => 31,
'weekday' => 7,
}
Hash(
map($maxima) |$key, $max| {
[
$key,
case $data[$key] {
'fqdn_rand': {fqdn_rand($max, "${seed}_${key}")}
undef: {'*'}
default: {$data[$key]}
},
]
}
)
}

File Metadata

Mime Type
text/plain
Expires
Jun 4 2025, 7:07 PM (10 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3296702

Event Timeline