Added an option to toggle replication choices.

New options for github replication and local replication.

Change-Id: I06a6ca5347232ec80e26f6116742ab0007435ffe
This commit is contained in:
Monty Taylor 2012-07-28 11:47:32 -05:00
parent d20c4523bf
commit 0b921968d1
3 changed files with 14 additions and 3 deletions

View File

@ -42,6 +42,10 @@
# to:
# http://tarballs.openstack.org/ci/gerrit-2.3.0.war
# Gerrit will be upgraded on the next puppet run.
# replicate_github:
# A boolean enabling replication to github
# replicate_local:
# A boolean enabling local replication for apache acceleration
# testmode:
# Set this to true to disable cron jobs and replication,
# which can interfere with testing.
@ -73,6 +77,9 @@ class gerrit($virtual_hostname=$fqdn,
$mysql_password,
$mysql_root_password,
$email_private_key,
$replicate_github=false,
$replicate_local=true,
$replication_targets=[],
$testmode=false
) {
@ -147,15 +154,14 @@ class gerrit($virtual_hostname=$fqdn,
# Skip replication if we're in test mode
if ($testmode == false) {
# TODO: This file needs to be templated with a boolean around
# enabling replication to github. Also, the local repos need
# TODO: The local repos need
# to be managed in here when we get project creation handled
file { '/home/gerrit2/review_site/etc/replication.config':
owner => 'root',
group => 'root',
mode => 444,
ensure => 'present',
source => 'puppet:///modules/gerrit/replication.config',
content => template('gerrit/replication.config.erb'),
replace => 'true',
require => File["/home/gerrit2/review_site/etc"]
}

View File

@ -1,14 +1,18 @@
# This file is managed by puppet.
# https://github.com/openstack/openstack-ci-puppet
<% if replicate_github -%>
[remote "github"]
url = git@github.com:${name}.git
authGroup = Anonymous Users
replicatePermissions = false
mirror = true
<% end -%>
<% if replicate_local -%>
[remote "local"]
url = file:///var/lib/git/${name}.git
replicationDelay = 0
threads = 4
mirror = true
<% end -%>

View File

@ -85,6 +85,7 @@ class openstack_project::gerrit (
mysql_password => $mysql_password,
mysql_root_password => $mysql_root_password,
email_private_key => $email_private_key,
replicate_github => true,
testmode => $testmode,
}
if ($testmode == false) {