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',
|
group => 'root',
|
||||||
mode => '0700',
|
mode => '0700',
|
||||||
}
|
}
|
||||||
|
file { '/root/tasks/backupsinglenodedb.sh':
|
||||||
|
ensure => absent,
|
||||||
|
}
|
||||||
if $environment == 'test' {
|
if $environment == 'test' {
|
||||||
sunet::scriptherder::cronjob { 'reboot-customer':
|
sunet::scriptherder::cronjob { 'reboot-customer':
|
||||||
cmd => '/root/tasks/reboot-customer.sh',
|
cmd => '/root/tasks/reboot-customer.sh',
|
||||||
|
@ -263,8 +266,8 @@ class sunetdrive::script (
|
||||||
# Opt in to folder structure in projectbuckets
|
# Opt in to folder structure in projectbuckets
|
||||||
if $customer in ['gih', 'mdu'] {
|
if $customer in ['gih', 'mdu'] {
|
||||||
sunet::scriptherder::cronjob { 'create_folders_in_project_buckets':
|
sunet::scriptherder::cronjob { 'create_folders_in_project_buckets':
|
||||||
cmd => 'true',
|
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
|
cmd => 'true',
|
||||||
}
|
}
|
||||||
file { '/root/tasks/create_folders_in_project_buckets.sh':
|
file { '/root/tasks/create_folders_in_project_buckets.sh':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
|
@ -293,9 +296,7 @@ class sunetdrive::script (
|
||||||
warn_criteria => ['exit_status=1','max_age=2h'],
|
warn_criteria => ['exit_status=1','max_age=2h'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file { '/root/tasks/backupsinglenodedb.sh':
|
if $customer == 'common' {
|
||||||
ensure => absent,
|
|
||||||
}
|
|
||||||
file { '/root/tasks/backupmultinodedb.sh':
|
file { '/root/tasks/backupmultinodedb.sh':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template('sunetdrive/script/backupmultinodedb.erb.sh'),
|
content => template('sunetdrive/script/backupmultinodedb.erb.sh'),
|
||||||
|
@ -303,14 +304,13 @@ class sunetdrive::script (
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0700',
|
mode => '0700',
|
||||||
}
|
}
|
||||||
sunet::scriptherder::cronjob { "backupmultinodedb":
|
sunet::scriptherder::cronjob { 'backupmultinodedb':
|
||||||
cmd => "/root/tasks/backupmultinodedb.sh",
|
cmd => '/root/tasks/backupmultinodedb.sh',
|
||||||
hour => '2',
|
hour => '2',
|
||||||
minute => '0',
|
minute => '0',
|
||||||
ok_criteria => ['exit_status=0','max_age=2d'],
|
ok_criteria => ['exit_status=0','max_age=2d'],
|
||||||
warn_criteria => ['exit_status=1','max_age=3d'],
|
warn_criteria => ['exit_status=1','max_age=3d'],
|
||||||
}
|
}
|
||||||
if $customer == 'common' {
|
|
||||||
if $environment == 'prod' {
|
if $environment == 'prod' {
|
||||||
file { '/root/tasks/aggregate.sh':
|
file { '/root/tasks/aggregate.sh':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
|
@ -327,6 +327,16 @@ class sunetdrive::script (
|
||||||
warn_criteria => ['exit_status=1','max_age=3d'],
|
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| {
|
$singlenodes.each | $singlenode| {
|
||||||
$multinode = hiera_hash('multinode_mapping')[$singlenode]['server']
|
$multinode = hiera_hash('multinode_mapping')[$singlenode]['server']
|
||||||
$multinodeserver = "${multinode}.${site_name}"
|
$multinodeserver = "${multinode}.${site_name}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue