Split gerrit cron jobs out.
Change-Id: I53faafc4d692c3dc62fd3356fd39f6e2ce64a481
This commit is contained in:
parent
8f1adc171f
commit
1b61f7673b
31
modules/gerrit/manifests/cron.pp
Normal file
31
modules/gerrit/manifests/cron.pp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
class gerrit::cron(
|
||||||
|
$script_user,
|
||||||
|
$script_key_file
|
||||||
|
) {
|
||||||
|
|
||||||
|
cron { "expireoldreviews":
|
||||||
|
user => gerrit2,
|
||||||
|
hour => 6,
|
||||||
|
minute => 3,
|
||||||
|
command => "python /usr/local/gerrit/scripts/expire_old_reviews.py ${script_user} ${script_key_file}",
|
||||||
|
require => File['/usr/local/gerrit/scripts'],
|
||||||
|
}
|
||||||
|
|
||||||
|
cron { "gerrit_repack":
|
||||||
|
user => gerrit2,
|
||||||
|
weekday => 0,
|
||||||
|
hour => 4,
|
||||||
|
minute => 7,
|
||||||
|
command => 'find /home/gerrit2/review_site/git/ -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \;',
|
||||||
|
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
|
||||||
|
}
|
||||||
|
|
||||||
|
cron { "removedbdumps":
|
||||||
|
user => gerrit2,
|
||||||
|
hour => 5,
|
||||||
|
minute => 1,
|
||||||
|
command => 'find /home/gerrit2/dbupdates/ -name "*.sql.gz" -mtime +30 -exec rm -f {} \;',
|
||||||
|
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -119,32 +119,6 @@ class gerrit($virtual_hostname='',
|
|||||||
require => File['/usr/local/gerrit/scripts'],
|
require => File['/usr/local/gerrit/scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
cron { "expireoldreviews":
|
|
||||||
user => gerrit2,
|
|
||||||
hour => 6,
|
|
||||||
minute => 3,
|
|
||||||
command => "python /usr/local/gerrit/scripts/expire_old_reviews.py ${script_user} ${script_key_file}",
|
|
||||||
require => File['/usr/local/gerrit/scripts'],
|
|
||||||
}
|
|
||||||
|
|
||||||
cron { "gerrit_repack":
|
|
||||||
user => gerrit2,
|
|
||||||
weekday => 0,
|
|
||||||
hour => 4,
|
|
||||||
minute => 7,
|
|
||||||
command => 'find /home/gerrit2/review_site/git/ -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \;',
|
|
||||||
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
|
|
||||||
}
|
|
||||||
|
|
||||||
cron { "removedbdumps":
|
|
||||||
user => gerrit2,
|
|
||||||
hour => 5,
|
|
||||||
minute => 1,
|
|
||||||
command => 'find /home/gerrit2/dbupdates/ -name "*.sql.gz" -mtime +30 -exec rm -f {} \;',
|
|
||||||
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} # testmode==false
|
} # testmode==false
|
||||||
|
|
||||||
file { "/var/log/gerrit":
|
file { "/var/log/gerrit":
|
||||||
|
@ -67,6 +67,10 @@ class openstack_project::gerrit (
|
|||||||
mysql_password => $mysql_password,
|
mysql_password => $mysql_password,
|
||||||
email_private_key => $email_private_key
|
email_private_key => $email_private_key
|
||||||
}
|
}
|
||||||
|
class { 'gerrit::cron':
|
||||||
|
script_user => $script_user,
|
||||||
|
script_key_file => $script_key_file,
|
||||||
|
}
|
||||||
class { 'github':
|
class { 'github':
|
||||||
github_projects => $github_projects,
|
github_projects => $github_projects,
|
||||||
github_user => $github_username,
|
github_user => $github_username,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user