Switch zuul and zuul-dev to project-config

Start using the project-config repo for Zuul.  Stop managing
/etc/zuul/layout in the zuul module itself in favor of the
project_config module.

Change-Id: I46ddb22c53783c0cffa665959f708b0568abd25f
This commit is contained in:
James E. Blair 2014-09-18 13:05:06 -07:00
parent a7810c3f99
commit 8347b74ace
6 changed files with 71 additions and 31 deletions

View File

@ -464,6 +464,7 @@ node 'nodepool.openstack.org' {
# Node-OS: precise
node 'zuul.openstack.org' {
class { 'openstack_project::zuul_prod':
project_config_repo => 'https://git.openstack.org/openstack-infra/project-config',
gerrit_server => 'review.openstack.org',
gerrit_user => 'jenkins',
gerrit_ssh_host_key => hiera('gerrit_ssh_rsa_pubkey_contents', 'XXX'),
@ -549,6 +550,7 @@ node 'zm04.openstack.org' {
# Node-OS: precise
node 'zuul-dev.openstack.org' {
class { 'openstack_project::zuul_dev':
project_config_repo => 'https://git.openstack.org/openstack-infra/project-config',
gerrit_server => 'review-dev.openstack.org',
gerrit_user => 'zuul-dev',
zuul_ssh_private_key => hiera('zuul_dev_ssh_private_key_contents', 'XXX'),

View File

@ -12,6 +12,7 @@ class openstack_project::zuul_dev(
$sysadmins = [],
$statsd_host = '',
$gearman_workers = [],
$project_config_repo = '',
) {
realize (
@ -28,6 +29,11 @@ class openstack_project::zuul_dev(
sysadmins => $sysadmins,
}
class { 'project_config':
url => $project_config_repo,
base => 'dev/',
}
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
@ -43,7 +49,11 @@ class openstack_project::zuul_dev(
git_name => 'OpenStack Jenkins',
}
class { '::zuul::server': }
class { '::zuul::server':
layout_dir => $::project_config::zuul_layout_dir,
require => $::project_config::config_dir,
}
class { '::zuul::merger': }
if $gerrit_ssh_host_key != '' {
@ -65,18 +75,6 @@ class openstack_project::zuul_dev(
}
}
file { '/etc/zuul/layout/layout.yaml':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/layout-dev.yaml',
notify => Exec['zuul-reload'],
}
file { '/etc/zuul/layout/openstack_functions.py':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/openstack_functions.py',
notify => Exec['zuul-reload'],
}
file { '/etc/zuul/logging.conf':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/logging.conf',

View File

@ -20,6 +20,7 @@ class openstack_project::zuul_prod(
$sysadmins = [],
$statsd_host = '',
$gearman_workers = [],
$project_config_repo = '',
) {
# Turn a list of hostnames into a list of iptables rules
$iptables_rules = regsubst ($gearman_workers, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 4730 -s \1 -j ACCEPT')
@ -31,6 +32,10 @@ class openstack_project::zuul_prod(
sysadmins => $sysadmins,
}
class { 'project_config':
url => $project_config_repo,
}
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
@ -54,7 +59,10 @@ class openstack_project::zuul_prod(
swift_default_logserver_prefix => $swift_default_logserver_prefix,
}
class { '::zuul::server': }
class { '::zuul::server':
layout_dir => $::project_config::zuul_layout_dir,
require => $::project_config::config_dir,
}
if $gerrit_ssh_host_key != '' {
file { '/home/zuul/.ssh':
@ -75,18 +83,6 @@ class openstack_project::zuul_prod(
}
}
file { '/etc/zuul/layout/layout.yaml':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/layout.yaml',
notify => Exec['zuul-reload'],
}
file { '/etc/zuul/layout/openstack_functions.py':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/openstack_functions.py',
notify => Exec['zuul-reload'],
}
file { '/etc/zuul/logging.conf':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/logging.conf',

View File

@ -0,0 +1,35 @@
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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: project_config
#
class project_config(
$url = '',
$base = '',
) {
$config_dir = Vcsrepo['/etc/project-config']
if (!defined($config_dir)) {
vcsrepo { '/etc/project-config':
ensure => latest,
provider => git,
revision => 'master',
source => $url,
}
}
$zuul_layout_dir = "/etc/project-config/${base}zuul"
}

View File

@ -146,11 +146,6 @@ class zuul (
ensure => directory,
}
file { '/etc/zuul/layout':
ensure => directory,
require => File['/etc/zuul'],
}
# 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':

View File

@ -16,6 +16,7 @@
# == Class: zuul::server
#
class zuul::server (
$layout_dir = '',
) {
service { 'zuul':
name => 'zuul',
@ -30,6 +31,19 @@ class zuul::server (
refreshonly => true,
}
file { '/etc/zuul/layout':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
recurse => true,
purge => true,
force => true,
source => $layout_dir,
require => File['/etc/zuul'],
notify => Exec['zuul-reload'],
}
include logrotate
logrotate::file { 'zuul.log':
log => '/var/log/zuul/zuul.log',