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',

View file

@ -17,9 +17,9 @@ PYTHONPATH=$PYTHONPATH:/var/rhizomatica/rccn
0 3 * * * root /var/rhizomatica/bin/sms_cleanup.sh
#RRDtools graphs
*/5 * * * * root /var/rhizomatica/bin/platform_update_rrd.sh
*/5 * * * * root /var/rhizomatica/bin/network_update_rrd.sh
*/1 * * * * root /var/rhizomatica/bin/network_update60.sh
<%= @comment -%>*/5 * * * * root /var/rhizomatica/bin/platform_update_rrd.sh
<%= @comment -%>*/5 * * * * root /var/rhizomatica/bin/network_update_rrd.sh
<%= @comment -%>*/1 * * * * root /var/rhizomatica/bin/network_update60.sh
#Bind check between OpenBSC and Kannel (disabled)
# */10 * * * * root /home/rhizomatica/bin/bind_check.sh