Merge "Add helpers to execute manage_projects"
This commit is contained in:
commit
67c5b14de3
34
manifests/fetch_remotes.pp
Normal file
34
manifests/fetch_remotes.pp
Normal file
@ -0,0 +1,34 @@
|
||||
# == Class: jeepyb::fetch_remotes
|
||||
|
||||
class jeepyb::fetch_remotes(
|
||||
$ensure = present,
|
||||
$user = 'gerrit2',
|
||||
$minute = '*/30',
|
||||
$logfile = '/var/log/jeepyb_gerritfetchremotes.log',
|
||||
$log_options = [
|
||||
'compress',
|
||||
'missingok',
|
||||
'rotate 30',
|
||||
'daily',
|
||||
'notifempty',
|
||||
'copytruncate',
|
||||
],
|
||||
) {
|
||||
validate_array($log_options)
|
||||
|
||||
include jeepyb
|
||||
|
||||
cron { 'jeepyb_gerritfetchremotes':
|
||||
ensure => $ensure,
|
||||
user => $user,
|
||||
minute => $minute,
|
||||
command => "sleep $((RANDOM\%60+90)) && /usr/local/bin/manage-projects -v >> ${logfile} 2>&1",
|
||||
}
|
||||
|
||||
include logrotate
|
||||
logrotate::file { $logfile:
|
||||
log => $logfile,
|
||||
options => $log_options,
|
||||
require => Cron['jeepyb_gerritfetchremotes'],
|
||||
}
|
||||
}
|
32
manifests/manage_projects.pp
Normal file
32
manifests/manage_projects.pp
Normal file
@ -0,0 +1,32 @@
|
||||
# == Class: jeepyb::manage_projects
|
||||
|
||||
class jeepyb::manage_projects(
|
||||
$timeout = 900, # 15 minutes
|
||||
$logfile = '/var/log/manage_projects.log',
|
||||
$log_options = [
|
||||
'compress',
|
||||
'missingok',
|
||||
'rotate 30',
|
||||
'daily',
|
||||
'notifempty',
|
||||
'copytruncate',
|
||||
],
|
||||
) {
|
||||
validate_array($log_options)
|
||||
|
||||
include jeepyb
|
||||
|
||||
exec { 'jeepyb_manage_projects':
|
||||
command => "/usr/local/bin/manage-projects -v >> ${logfile} 2>&1",
|
||||
timeout => $timeout, # 15 minutes
|
||||
refreshonly => true,
|
||||
logoutput => true,
|
||||
}
|
||||
|
||||
include logrotate
|
||||
logrotate::file { $logfile:
|
||||
log => $logfile,
|
||||
options => $log_options,
|
||||
require => Exec['jeepyb_manage_projects'],
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user