eae0e69432
identify_unused_accounts.py is a one-time script to be run manually to clean up the database to make the sync script run much faster. Change-Id: I0e954f86dd6bb2fedd6ea65aa9be3d5188e04eab Reviewed-on: https://review.openstack.org/17169 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
38 lines
978 B
Puppet
38 lines
978 B
Puppet
# == Class: launchpad_sync
|
|
#
|
|
class launchpad_sync(
|
|
$script_logging_conf = '',
|
|
$script_key_file = '/home/gerrit2/.ssh/id_rsa',
|
|
$script_user = 'update',
|
|
$user = 'gerrit2'
|
|
) {
|
|
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':
|
|
ensure => present,
|
|
group => 'root',
|
|
mode => '0755',
|
|
owner => 'root',
|
|
source => 'puppet:///modules/launchpad_sync/update_gerrit_users.py',
|
|
}
|
|
|
|
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} ${script_logging_conf}",
|
|
require => File['/usr/local/bin/update_gerrit_users.py'],
|
|
}
|
|
}
|
|
|
|
# vim:sw=2:ts=2:expandtab:textwidth=79
|