Fix zuul installation

The following items were missing from an automated zuul install:

 * A pre-populated known hosts file
 * The git user/email for creating commits (.gitconfig existed
   on zuul.o.o, but switch to using zuul's config file instead).

Also, make sure that the mergers specify the zuul server as the
gearman server address rather than localhost.

Change-Id: I47a473f60c4b5b2daaa910aa61cdf6e0c6fe1528
This commit is contained in:
James E. Blair 2014-02-17 17:20:35 -08:00 committed by Jeremy Stanley
parent 794b1d4e89
commit 17e09934db
6 changed files with 86 additions and 1 deletions

View File

@ -502,6 +502,7 @@ node 'zuul.openstack.org' {
class { 'openstack_project::zuul_prod':
gerrit_server => 'review.openstack.org',
gerrit_user => 'jenkins',
gerrit_ssh_host_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'),
url_pattern => 'http://logs.openstack.org/{build.parameters[LOG_PATH]}',
zuul_url => 'http://zuul.openstack.org/p',
@ -526,8 +527,10 @@ node 'zuul.openstack.org' {
node 'zm01.openstack.org' {
class { 'openstack_project::zuul_merger':
gearman_server => 'zuul.openstack.org',
gerrit_server => 'review.openstack.org',
gerrit_user => 'jenkins',
gerrit_ssh_host_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'),
sysadmins => hiera('sysadmins'),
}
@ -535,8 +538,10 @@ node 'zm01.openstack.org' {
node 'zm02.openstack.org' {
class { 'openstack_project::zuul_merger':
gearman_server => 'zuul.openstack.org',
gerrit_server => 'review.openstack.org',
gerrit_user => 'jenkins',
gerrit_ssh_host_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'),
sysadmins => hiera('sysadmins'),
}

View File

@ -2,14 +2,16 @@
#
class openstack_project::zuul_dev(
$vhost_name = $::fqdn,
$gearman_server = '127.0.0.1',
$gerrit_server = '',
$gerrit_user = '',
$gerrit_ssh_host_key = '',
$zuul_ssh_private_key = '',
$url_pattern = '',
$zuul_url = '',
$sysadmins = [],
$statsd_host = '',
$gearman_workers = []
$gearman_workers = [],
) {
# 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')
@ -23,6 +25,7 @@ class openstack_project::zuul_dev(
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
gerrit_server => $gerrit_server,
gerrit_user => $gerrit_user,
zuul_ssh_private_key => $zuul_ssh_private_key,
@ -31,11 +34,32 @@ class openstack_project::zuul_dev(
job_name_in_report => true,
status_url => 'http://zuul-dev.openstack.org/',
statsd_host => $statsd_host,
git_email => 'jenkins@openstack.org',
git_name => 'OpenStack Jenkins',
}
class { '::zuul::server': }
class { '::zuul::merger': }
if $gerrit_ssh_host_key != '' {
file { '/home/zuul/.ssh':
ensure => directory,
owner => 'zuul',
group => 'zuul',
mode => '0700',
require => Class['::zuul'],
}
file { '/home/zuul/.ssh/known_hosts':
ensure => present,
owner => 'zuul',
group => 'zuul',
mode => '0600',
content => "review.openstack.org ${gerrit_ssh_host_key}",
replace => true,
require => File['/home/zuul/.ssh'],
}
}
file { '/etc/zuul/layout.yaml':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/layout-dev.yaml',

View File

@ -2,8 +2,10 @@
#
class openstack_project::zuul_merger(
$vhost_name = $::fqdn,
$gearman_server = '127.0.0.1',
$gerrit_server = '',
$gerrit_user = '',
$gerrit_ssh_host_key = '',
$zuul_ssh_private_key = '',
$zuul_url = "http://${::fqdn}/p",
$sysadmins = [],
@ -16,14 +18,36 @@ class openstack_project::zuul_merger(
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
gerrit_server => $gerrit_server,
gerrit_user => $gerrit_user,
zuul_ssh_private_key => $zuul_ssh_private_key,
zuul_url => $zuul_url,
git_email => 'jenkins@openstack.org',
git_name => 'OpenStack Jenkins',
}
class { '::zuul::merger': }
if $gerrit_ssh_host_key != '' {
file { '/home/zuul/.ssh':
ensure => directory,
owner => 'zuul',
group => 'zuul',
mode => '0700',
require => Class['::zuul'],
}
file { '/home/zuul/.ssh/known_hosts':
ensure => present,
owner => 'zuul',
group => 'zuul',
mode => '0600',
content => "review.openstack.org ${gerrit_ssh_host_key}",
replace => true,
require => File['/home/zuul/.ssh'],
}
}
file { '/etc/zuul/merger-logging.conf':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/merger-logging.conf',

View File

@ -2,8 +2,10 @@
#
class openstack_project::zuul_prod(
$vhost_name = $::fqdn,
$gearman_server = '127.0.0.1',
$gerrit_server = '',
$gerrit_user = '',
$gerrit_ssh_host_key = '',
$zuul_ssh_private_key = '',
$url_pattern = '',
$zuul_url = '',
@ -23,6 +25,7 @@ class openstack_project::zuul_prod(
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
gerrit_server => $gerrit_server,
gerrit_user => $gerrit_user,
zuul_ssh_private_key => $zuul_ssh_private_key,
@ -31,10 +34,31 @@ class openstack_project::zuul_prod(
job_name_in_report => true,
status_url => 'http://status.openstack.org/zuul/',
statsd_host => $statsd_host,
git_email => 'jenkins@openstack.org',
git_name => 'OpenStack Jenkins',
}
class { '::zuul::server': }
if $gerrit_ssh_host_key != '' {
file { '/home/zuul/.ssh':
ensure => directory,
owner => 'zuul',
group => 'zuul',
mode => '0700',
require => Class['::zuul'],
}
file { '/home/zuul/.ssh/known_hosts':
ensure => present,
owner => 'zuul',
group => 'zuul',
mode => '0600',
content => "review.openstack.org ${gerrit_ssh_host_key}",
replace => true,
require => File['/home/zuul/.ssh'],
}
}
file { '/etc/zuul/layout.yaml':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/layout.yaml',

View File

@ -32,6 +32,8 @@ class zuul (
$job_name_in_report = false,
$revision = 'master',
$statsd_host = '',
$git_email = '',
$git_name = '',
) {
include apache
include pip

View File

@ -24,3 +24,9 @@ zuul_url=<%= zuul_url %>
git_dir=/var/lib/zuul/git
zuul_url=<%= zuul_url %>
log_config=/etc/zuul/merger-logging.conf
<% if git_email != "" -%>
git_user_email=<%= git_email %>
<% end -%>
<% if git_name != "" -%>
git_user_name=<%= git_name %>
<% end -%>