6ddb5922a4
The zuul user on zuul-dev.o.o could not connect to review-dev.o.o because the /home/zuul/.ssh/known_hosts file did not get created. This causes zuul-merger to fail because it needs that to clone repos from review-dev.o.o. This change passes the gerrit public key from review-dev.o.o so that puppet can create the known_hosts file. Change-Id: Iae5d63cc7fd01dc68e4eef96a29bccda6f047eb3
96 lines
2.7 KiB
Puppet
96 lines
2.7 KiB
Puppet
# == Class: openstack_project::zuul_dev
|
|
#
|
|
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 = '',
|
|
$status_url = 'http://zuul-dev.openstack.org',
|
|
$zuul_url = '',
|
|
$sysadmins = [],
|
|
$statsd_host = '',
|
|
$gearman_workers = [],
|
|
$project_config_repo = '',
|
|
) {
|
|
|
|
realize (
|
|
User::Virtual::Localuser['zaro'],
|
|
)
|
|
|
|
# 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')
|
|
|
|
class { 'openstack_project::server':
|
|
iptables_public_tcp_ports => [80],
|
|
iptables_rules6 => $iptables_rules,
|
|
iptables_rules4 => $iptables_rules,
|
|
sysadmins => $sysadmins,
|
|
}
|
|
|
|
class { 'project_config':
|
|
url => $project_config_repo,
|
|
base => '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,
|
|
url_pattern => $url_pattern,
|
|
zuul_url => $zuul_url,
|
|
job_name_in_report => true,
|
|
status_url => $status_url,
|
|
statsd_host => $statsd_host,
|
|
git_email => 'jenkins@openstack.org',
|
|
git_name => 'OpenStack Jenkins',
|
|
}
|
|
|
|
class { '::zuul::server':
|
|
layout_dir => $::project_config::zuul_layout_dir,
|
|
require => $::project_config::config_dir,
|
|
}
|
|
|
|
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-dev.openstack.org,23.253.78.13,2001:4800:7817:101:be76:4eff:fe04 ${gerrit_ssh_host_key}",
|
|
replace => true,
|
|
require => File['/home/zuul/.ssh'],
|
|
}
|
|
}
|
|
|
|
file { '/etc/zuul/logging.conf':
|
|
ensure => present,
|
|
source => 'puppet:///modules/openstack_project/zuul/logging.conf',
|
|
notify => Exec['zuul-reload'],
|
|
}
|
|
|
|
file { '/etc/zuul/gearman-logging.conf':
|
|
ensure => present,
|
|
source => 'puppet:///modules/openstack_project/zuul/gearman-logging.conf',
|
|
notify => Exec['zuul-reload'],
|
|
}
|
|
|
|
file { '/etc/zuul/merger-logging.conf':
|
|
ensure => present,
|
|
source => 'puppet:///modules/openstack_project/zuul/merger-logging.conf',
|
|
}
|
|
}
|