Enable commenting of cronjobs if the system is not yet in production

If a system is not fully deployed, then these cronjobs will
generate errors and a lot of email.
This commit is contained in:
Keith Whyte 2020-10-21 18:31:18 +02:00
parent 680e0b53e2
commit 814c343721
2 changed files with 10 additions and 3 deletions

View file

@ -15,6 +15,7 @@ class rhizo_base {
$mail_admins = hiera('rhizo::mail_admins')
$smsc_password = hiera('rhizo::smsc_password')
$password_hash = hiera('rhizo::password_hash')
$production = hiera('rhizo::production', 1)
# Configuration settings
$notouchcron = hiera('rhizo::notouchcron', 0)
@ -669,6 +670,12 @@ schedule { 'never':
content => template('rhizo_base/apcupsd.erb'),
}
$comment = $production ? {
0 => '#',
1 => '',
default => ''
}
unless $notouchcron == 1 {
file { '/etc/cron.d/rhizomatica':
ensure => 'present',