Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yath
Created April 6, 2013 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yath/5325502 to your computer and use it in GitHub Desktop.
Save yath/5325502 to your computer and use it in GitHub Desktop.
#!/bin/sh
# managed by Class['common::sleeperservice']
#
# sleep some time before running cron jobs
sleep <%= delay %>m
class common::sleeperservice {
$delay = fqdn_rand(120)
# suffix() is in https://github.com/puppetlabs/puppetlabs-stdlib/commit/88a93ac6cdf38045e1cf29325a70e5e4143016b3
$files = regsubst(prefix(['daily', 'weekly', 'monthly'], '/etc/cron.'), '$', '/000-sleeper-service')
file{$files:
ensure => present,
content => template('common/sleeper-service.erb'),
mode => '0755',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment