diff --git a/manifests/site.pp b/manifests/site.pp index 095ee5065b..6da6b0e597 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -458,7 +458,24 @@ node 'zuul.openstack.org' { 'jenkins04.openstack.org', 'jenkins-dev.openstack.org', ], - } + replication_targets => [ + { + name => 'git01', + url => 'ssh://zuul@git01.openstack.org:/var/lib/git/zuul', + }, + { + name => 'git02', + url => 'ssh://zuul@git02.openstack.org:/var/lib/git/zuul', + }, + { + name => 'git03', + url => 'ssh://zuul@git03.openstack.org:/var/lib/git/zuul', + }, + { + name => 'git04', + url => 'ssh://zuul@git04.openstack.org:/var/lib/git/zuul', + }, + ] } node 'zuul-dev.openstack.org' { diff --git a/modules/openstack_project/manifests/zuul_prod.pp b/modules/openstack_project/manifests/zuul_prod.pp index 0c377f1700..b5a25bce11 100644 --- a/modules/openstack_project/manifests/zuul_prod.pp +++ b/modules/openstack_project/manifests/zuul_prod.pp @@ -9,7 +9,8 @@ class openstack_project::zuul_prod( $zuul_url = '', $sysadmins = [], $statsd_host = '', - $gearman_workers = [] + $gearman_workers = [], + $replication_targets = [] ) { # Turn a list of hostnames into a list of iptables rules $iptables_rules = regsubst ($gearman_workers, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 4730 -s \1 -j ACCEPT') @@ -32,6 +33,7 @@ class openstack_project::zuul_prod( job_name_in_report => true, status_url => 'http://status.openstack.org/zuul/', statsd_host => $statsd_host, + replication_targets => $replication_targets, } file { '/etc/zuul/layout.yaml': diff --git a/modules/zuul/manifests/init.pp b/modules/zuul/manifests/init.pp index 0a31f10b2a..8f3c9d8c90 100644 --- a/modules/zuul/manifests/init.pp +++ b/modules/zuul/manifests/init.pp @@ -32,7 +32,8 @@ class zuul ( $push_change_refs = false, $job_name_in_report = false, $revision = 'master', - $statsd_host = '' + $statsd_host = '', + $replication_targets = [] ) { include apache include pip diff --git a/modules/zuul/templates/zuul.conf.erb b/modules/zuul/templates/zuul.conf.erb index 7302201776..ddcc36472f 100644 --- a/modules/zuul/templates/zuul.conf.erb +++ b/modules/zuul/templates/zuul.conf.erb @@ -20,3 +20,9 @@ url_pattern=<%= url_pattern %> status_url=<%= status_url %> job_name_in_report=<%= job_name_in_report %> zuul_url=<%= zuul_url %> + +<% if replication_targets != [] -%> +[replication] +<% replication_targets.each do |target| -%> +<%= target['name'] %>=<%= target['url'] %> +<% end -%>