Add zuulv3 configuration file

Rather then updating the existing zuul.conf.erb file, create a new
zuulv3.conf.erb specific to zuulv3. Add new settings for tennant /
zookeeper configurations.

Change-Id: I6d0ec2ef2d1b0c86fdcd06bfca01c02a6fffa7f3
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-06-02 12:27:37 -04:00
parent cd746e236b
commit 84488919c6
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
2 changed files with 51 additions and 1 deletions

View File

@ -28,6 +28,8 @@ class zuul (
$gerrit_baseurl = '',
$zuul_ssh_private_key = '',
$layout_file_name = 'layout.yaml',
$zookeeper_hosts = '127.0.0.1:2181',
$tenant_file_name = 'main.yaml',
$url_pattern = '',
$status_url = "https://${::fqdn}/",
$zuul_url = '',
@ -65,6 +67,7 @@ class zuul (
$nodes = [],
$connections = [],
$python_version = 2,
$zuulv3 = false,
) {
include ::httpd
include ::pip
@ -181,13 +184,19 @@ class zuul (
ensure => directory,
}
if $zuulv3 {
$zuul_conf_content = template('zuul/zuulv3.conf.erb')
} else {
$zuul_conf_content = template('zuul/zuul.conf.erb')
}
# TODO: We should put in notify either Service['zuul'] or Exec['zuul-reload']
# at some point, but that still has some problems.
file { '/etc/zuul/zuul.conf':
ensure => present,
owner => 'zuul',
mode => '0400',
content => template('zuul/zuul.conf.erb'),
content => $zuul_conf_content,
require => [
File['/etc/zuul'],
User['zuul'],

41
templates/zuulv3.conf.erb Normal file
View File

@ -0,0 +1,41 @@
[gearman]
server=<%= @gearman_server %>
check_job_registration=<%= @gearman_check_job_registration %>
[gearman_server]
start=<%= @internal_gearman %>
log_config=/etc/zuul/gearman-logging.conf
[zuul]
tenant_config=/etc/zuul/layout/<%= @tenant_file_name %>
log_config=/etc/zuul/logging.conf
state_dir=/var/lib/zuul
url_pattern=<%= @url_pattern %>
status_url=<%= @status_url %>
job_name_in_report=<%= @job_name_in_report %>
zookeeper_hosts=<%= @zookeeper_hosts %>
[merger]
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 -%>
[executor]
log_config=/etc/zuul/launcher-logging.conf
<% if @worker_private_key_file != "" -%>
private_key_file=<%= @worker_private_key_file %>
<% end -%>
<% @connections.each do |connection| -%>
[connection "<%= connection['name'] %>"]
<% connection.each do |key,value| -%>
<%= key %>=<%= value %>
<% end -%>
<% end -%>