Split gerrit remote fetcher into a module.

Change-Id: I85fd220da7105363471a1e67fec86cd25dac95c1
This commit is contained in:
Monty Taylor 2012-07-23 09:43:24 -05:00
parent e3e9aaba10
commit 4774c02153
4 changed files with 24 additions and 23 deletions

View File

@ -69,7 +69,6 @@ class gerrit($virtual_hostname='',
$httpd_maxthreads='',
$httpd_maxwait='',
$github_projects = [],
$upstream_projects = [],
$commentlinks = [ { name => 'changeid',
match => '(I[0-9a-f]{8,40})',
link => '#q,$1,n,z' },
@ -179,12 +178,6 @@ class gerrit($virtual_hostname='',
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
}
cron { "gerritfetchremotes":
user => gerrit2,
minute => "*/30",
command => 'sleep $((RANDOM\%60+90)) && python /usr/local/gerrit/scripts/fetch_remotes.py',
require => File['/usr/local/gerrit/scripts'],
}
} # testmode==false
@ -237,16 +230,6 @@ class gerrit($virtual_hostname='',
require => User["gerrit2"]
}
file { '/home/gerrit2/remotes.config':
owner => 'root',
group => 'root',
mode => 444,
ensure => 'present',
content => template('gerrit/remotes.config.erb'),
replace => 'true',
require => User["gerrit2"]
}
file { '/home/gerrit2/review_site/static/title.png':
ensure => 'present',
source => "puppet:///modules/gerrit/${logo}",

View File

@ -0,0 +1,18 @@
class gerrit::remotes($upstream_projects) {
cron { "gerritfetchremotes":
user => gerrit2,
minute => "*/30",
command => 'sleep $((RANDOM\%60+90)) && python /usr/local/gerrit/scripts/fetch_remotes.py',
require => File['/usr/local/gerrit/scripts'],
}
file { '/home/gerrit2/remotes.config':
owner => 'root',
group => 'root',
mode => 444,
ensure => 'present',
content => template('gerrit/remotes.config.erb'),
replace => 'true',
require => User["gerrit2"]
}
}

View File

@ -14,7 +14,6 @@ class openstack_project::gerrit (
$httpd_maxthreads='',
$httpd_maxwait='',
$github_projects = [],
$upstream_projects = [],
$war,
$script_user,
$script_key_file,
@ -51,7 +50,6 @@ class openstack_project::gerrit (
httpd_maxthreads => $httpd_maxthreads,
httpd_maxwait => $httpd_maxwait,
github_projects => $github_projects,
upstream_projects => $upstream_projects,
war => $war,
script_user => $script_user,
script_key_file => $script_key_file,

View File

@ -38,10 +38,6 @@ class openstack_project::review {
sshd_threads => '100',
httpd_maxwait => '5000min',
github_projects => $openstack_project::project_list,
upstream_projects => [ {
name => 'openstack-ci/gerrit',
remote => 'https://gerrit.googlesource.com/gerrit'
} ],
war => 'http://tarballs.openstack.org/ci/gerrit-2.4.1-10-g63110fd.war',
script_user => 'launchpadsync',
script_key_file => '/home/gerrit2/.ssh/launchpadsync_rsa',
@ -56,4 +52,10 @@ class openstack_project::review {
gerritbot_server => 'irc.freenode.net',
gerritbot_user => 'gerritbot'
}
class { 'gerrit::remotes':
upstream_projects => [ {
name => 'openstack-ci/gerrit',
remote => 'https://gerrit.googlesource.com/gerrit'
} ],
}
}