Fix so cron job only runns in common
This commit is contained in:
parent
422ebd7ace
commit
5be9aedc56
1 changed files with 30 additions and 20 deletions
|
@ -218,6 +218,9 @@ class sunetdrive::script (
|
|||
group => 'root',
|
||||
mode => '0700',
|
||||
}
|
||||
file { '/root/tasks/backupsinglenodedb.sh':
|
||||
ensure => absent,
|
||||
}
|
||||
if $environment == 'test' {
|
||||
sunet::scriptherder::cronjob { 'reboot-customer':
|
||||
cmd => '/root/tasks/reboot-customer.sh',
|
||||
|
@ -263,8 +266,8 @@ class sunetdrive::script (
|
|||
# Opt in to folder structure in projectbuckets
|
||||
if $customer in ['gih', 'mdu'] {
|
||||
sunet::scriptherder::cronjob { 'create_folders_in_project_buckets':
|
||||
cmd => 'true',
|
||||
ensure => absent,
|
||||
cmd => 'true',
|
||||
}
|
||||
file { '/root/tasks/create_folders_in_project_buckets.sh':
|
||||
ensure => absent,
|
||||
|
@ -293,9 +296,7 @@ class sunetdrive::script (
|
|||
warn_criteria => ['exit_status=1','max_age=2h'],
|
||||
}
|
||||
}
|
||||
file { '/root/tasks/backupsinglenodedb.sh':
|
||||
ensure => absent,
|
||||
}
|
||||
if $customer == 'common' {
|
||||
file { '/root/tasks/backupmultinodedb.sh':
|
||||
ensure => file,
|
||||
content => template('sunetdrive/script/backupmultinodedb.erb.sh'),
|
||||
|
@ -303,14 +304,13 @@ class sunetdrive::script (
|
|||
group => 'root',
|
||||
mode => '0700',
|
||||
}
|
||||
sunet::scriptherder::cronjob { "backupmultinodedb":
|
||||
cmd => "/root/tasks/backupmultinodedb.sh",
|
||||
sunet::scriptherder::cronjob { 'backupmultinodedb':
|
||||
cmd => '/root/tasks/backupmultinodedb.sh',
|
||||
hour => '2',
|
||||
minute => '0',
|
||||
ok_criteria => ['exit_status=0','max_age=2d'],
|
||||
warn_criteria => ['exit_status=1','max_age=3d'],
|
||||
}
|
||||
if $customer == 'common' {
|
||||
if $environment == 'prod' {
|
||||
file { '/root/tasks/aggregate.sh':
|
||||
ensure => file,
|
||||
|
@ -327,6 +327,16 @@ class sunetdrive::script (
|
|||
warn_criteria => ['exit_status=1','max_age=3d'],
|
||||
}
|
||||
}
|
||||
} else {
|
||||
# Not common
|
||||
file { '/root/tasks/backupmultinodedb.sh':
|
||||
ensure => absent,
|
||||
}
|
||||
sunet::scriptherder::cronjob { 'backupmultinodedb':
|
||||
ensure => absent,
|
||||
cmd => 'true',
|
||||
}
|
||||
}
|
||||
$singlenodes.each | $singlenode| {
|
||||
$multinode = hiera_hash('multinode_mapping')[$singlenode]['server']
|
||||
$multinodeserver = "${multinode}.${site_name}"
|
||||
|
|
Loading…
Add table
Reference in a new issue