The idea is that an openstackci user should be able to say "give me an openstackci::jenkins_master" and part of that should be to set up JJB correctly. So we move JJB setup into jenkins_master to make that happen. There was a request to make these JJB param names more consistent and less ambiguous to third party devs in change Ibc7a46a8cb364 so this change also updates jjb param names to be more sensible. Update the zuul scheduler as part of this patch to avoid puppet duplicate definition errors for Class['project_config'] that would result when this patch lands. Needed-by: Id10d63745fff43f3188e630df38c8c9ba97c3e17 Change-Id: I50d4d2dd4209250e14ceeb7ff8ddf5b6ba3e2ad4
107 lines
3.6 KiB
Puppet
107 lines
3.6 KiB
Puppet
# Copyright (c) 2012-2015 Hewlett-Packard Development Company, L.P.
|
|
# Copyright (c) 2015 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License
|
|
|
|
# == Class: openstackci::zuul_scheduler
|
|
#
|
|
class openstackci::zuul_scheduler(
|
|
$vhost_name = $::fqdn,
|
|
$gearman_server = '127.0.0.1',
|
|
$gerrit_server = '',
|
|
$gerrit_user = '',
|
|
$known_hosts_content = '',
|
|
$zuul_ssh_private_key = '',
|
|
$url_pattern = '',
|
|
$zuul_url = '',
|
|
$job_name_in_report = true,
|
|
$status_url = 'http://status.domain.example/zuul/',
|
|
$swift_authurl = '',
|
|
$swift_auth_version = '',
|
|
$swift_user = '',
|
|
$swift_key = '',
|
|
$swift_tenant_name = '',
|
|
$swift_region_name = '',
|
|
$swift_default_container = '',
|
|
$swift_default_logserver_prefix = '',
|
|
$swift_default_expiry = 7200,
|
|
$proxy_ssl_cert_file_contents = '',
|
|
$proxy_ssl_key_file_contents = '',
|
|
$proxy_ssl_chain_file_contents = '',
|
|
$statsd_host = '',
|
|
$project_config_repo = '',
|
|
$project_config_base = '',
|
|
$git_email = 'zuul@domain.example',
|
|
$git_name = 'Zuul',
|
|
) {
|
|
|
|
if ! defined(Class['project_config']) {
|
|
class { 'project_config':
|
|
url => $project_config_repo,
|
|
base => $project_config_base,
|
|
}
|
|
}
|
|
|
|
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 => $job_name_in_report,
|
|
status_url => $status_url,
|
|
statsd_host => $statsd_host,
|
|
git_email => $git_email,
|
|
git_name => $git_name,
|
|
swift_authurl => $swift_authurl,
|
|
swift_auth_version => $swift_auth_version,
|
|
swift_user => $swift_user,
|
|
swift_key => $swift_key,
|
|
swift_tenant_name => $swift_tenant_name,
|
|
swift_region_name => $swift_region_name,
|
|
swift_default_container => $swift_default_container,
|
|
swift_default_logserver_prefix => $swift_default_logserver_prefix,
|
|
swift_default_expiry => $swift_default_expiry,
|
|
proxy_ssl_cert_file_contents => $proxy_ssl_cert_file_contents,
|
|
proxy_ssl_key_file_contents => $proxy_ssl_key_file_contents,
|
|
proxy_ssl_chain_file_contents => $proxy_ssl_chain_file_contents,
|
|
}
|
|
|
|
class { '::zuul::server':
|
|
layout_dir => $::project_config::zuul_layout_dir,
|
|
require => $::project_config::config_dir,
|
|
}
|
|
|
|
if $known_hosts_content != '' {
|
|
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 => $known_hosts_content,
|
|
replace => true,
|
|
require => File['/home/zuul/.ssh'],
|
|
}
|
|
}
|
|
}
|