Allow passing arbitrary connection objects

The fixed 'gerrit' and 'smtp' connection entries are deprecated.
We should allow users to pass in any connection information and
write that to the config file.

Change-Id: I4ebb7cd6b64d1854cd2e8e6e146572330558864c
This commit is contained in:
James E. Blair 2017-04-25 07:48:34 -07:00
parent 6d356334de
commit 5d5bdb0e42
2 changed files with 11 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class zuul (
$worker_username = '',
$sites = [],
$nodes = [],
$connections = [],
) {
include ::httpd
include ::pip

View File

@ -6,6 +6,7 @@ check_job_registration=<%= @gearman_check_job_registration %>
start=<%= @internal_gearman %>
log_config=/etc/zuul/gearman-logging.conf
<% if @gerrit_server != "" -%>
[gerrit]
server=<%= @gerrit_server %>
user=<%= @gerrit_user %>
@ -13,6 +14,7 @@ sshkey=/var/lib/zuul/ssh/id_rsa
<% if @gerrit_baseurl != "" -%>
baseurl=<%= @gerrit_baseurl %>
<% end -%>
<% end -%>
[zuul]
layout_config=/etc/zuul/layout/<%= @layout_file_name %>
@ -75,6 +77,14 @@ accept_nodes=<%= @accept_nodes %>
<% end -%>
<% end -%>
<% @connections.each do |connection| -%>
[connection "<%= connection['name'] %>"]
<% connection.each do |key,value| -%>
<%= key %>=<%= value %>
<% end -%>
<% end -%>
<% @sites.each do |site| -%>
[site "<%= site['name'] %>"]
host=<%= site['host'] %>