
The gerrit user sync script is showing the same symptoms as the gerrit hook scripts when it comes to hanging on a launchpad connection. Timeout this script as well so that it can be run again instead of perpetually doing nothing. Change-Id: I8d44c6eac76f5820f28eb1723640ce4dac57413b Reviewed-on: https://review.openstack.org/11503 Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
37 lines
903 B
Puppet
37 lines
903 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 65m 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'],
|
|
}
|
|
|
|
}
|