diff --git a/manifests/init.pp b/manifests/init.pp index 04faa35..6bf9170 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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'], diff --git a/templates/zuulv3.conf.erb b/templates/zuulv3.conf.erb new file mode 100644 index 0000000..1f83bdd --- /dev/null +++ b/templates/zuulv3.conf.erb @@ -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 -%>