system-config/modules/launchpad_sync/manifests/init.pp
Clark Boylan 92ede36c64 Log start/stop times of gerrit user sync script.
Add rudimentary logging to the gerrit user sync script. Log the start
and stop times of script runs. Also modify timeout in the cronjob to
allow the job to run for up to 8 hours in order to get better log data.

Change-Id: I193911e2d4dcd6448ef8a61360e6fc9fff287c1a
Reviewed-on: https://review.openstack.org/11658
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-08-20 17:39:41 +00:00

37 lines
902 B
Puppet

class launchpad_sync(
$user='gerrit2',
$script_user='update',
$script_key_file='/home/gerrit2/.ssh/id_rsa',
$site,
$root_team
) {
include mysql
include mysql::python
$packages = [
"python-openid", # for launchpad sync script
"python-launchpadlib", # for launchpad sync script
]
package { $packages:
ensure => present,
}
file { '/usr/local/bin/update_gerrit_users.py':
owner => 'root',
group => 'root',
mode => 755,
source => "puppet:///modules/launchpad_sync/update_gerrit_users.py",
ensure => present,
}
cron { "sync_launchpad_users":
user => $user,
minute => "*/15",
command => "sleep $((RANDOM\\%60+60)) && timeout -k 5m 8h python /usr/local/bin/update_gerrit_users.py ${script_user} ${script_key_file} ${site} ${root_team}",
require => File['/usr/local/bin/update_gerrit_users.py'],
}
}