From 0cc4c05cbdb2d2df9691c3abb37fd6167d05362f Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 3 Aug 2017 21:00:08 -0400 Subject: [PATCH] Move zuul site variables file into init.pp Because we need to update zuul.conf with the path to the file, we actually need to configure this variable within init.pp. Change-Id: I734f2c338ceab2b1da2a3245423cb912b7dd8c00 Depends-On: I7983ff9cfaea1ee6d3b099824b5f31df98ce72a5 Signed-off-by: Paul Belanger --- manifests/executor.pp | 13 ------------- manifests/init.pp | 13 +++++++++++++ templates/zuulv3.conf.erb | 3 +++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/manifests/executor.pp b/manifests/executor.pp index f3ce82c..521464c 100644 --- a/manifests/executor.pp +++ b/manifests/executor.pp @@ -19,7 +19,6 @@ class zuul::executor ( $ensure = undef, $manage_log_conf = true, - $site_variable_yaml_file = undef, ) { include ::apt apt::ppa { 'ppa:openstack-ci-core/bubblewrap': } @@ -59,18 +58,6 @@ class zuul::executor ( } } - if $site_variable_yaml_file != undef { - file { '/etc/zuul/site-variables.yaml': - ensure => file, - group => 'zuul', - mode => '0644', - owner => 'zuul', - replace => true, - require => File['/etc/zuul'], - source => $site_variable_yaml_file, - } - } - include ::logrotate ::logrotate::file { 'executor.log': log => '/var/log/zuul/executor.log', diff --git a/manifests/init.pp b/manifests/init.pp index 707716a..a2989cf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -86,6 +86,7 @@ class zuul ( $gearman_ssl_ca = undef, $zuul_web_url = 'http://127.0.0.1:9000', $zuul_scheduler_url = 'http://127.0.0.1:8001', + $site_variables_yaml_file = undef, ) { include ::httpd include ::pip @@ -549,6 +550,18 @@ class zuul ( } } + if $site_variables_yaml_file != undef { + file { '/etc/zuul/site-variables.yaml': + ensure => file, + group => 'zuul', + mode => '0644', + owner => 'zuul', + replace => true, + require => File['/etc/zuul'], + source => $site_variables_yaml_file, + } + } + ::httpd::vhost { $vhost_name: port => 443, # Is required despite not being used. docroot => 'MEANINGLESS ARGUMENT', diff --git a/templates/zuulv3.conf.erb b/templates/zuulv3.conf.erb index 5ecc556..df69eaf 100644 --- a/templates/zuulv3.conf.erb +++ b/templates/zuulv3.conf.erb @@ -48,6 +48,9 @@ git_user_name=<%= @git_name %> [executor] log_config=/etc/zuul/executor-logging.conf +<% if @site_variables_yaml_file != nil -%> +variables=/etc/zuul/site-variables.yaml +<% end -%> <% if @worker_private_key_file != "" -%> private_key_file=<%= @worker_private_key_file %> <% end -%>