Antoine Musso 9f424f3968 zuul: learn the ability to set push_change_refs
push_change_refs controls whether zuul should push its reference back in
Gerrit.  This might not be always wanted, for example on very busy
Gerrit installation that never use the refs/zuul/* hierarchy for any
purpose.

Pushing back to Gerrit is now disabled by default and is explicitly
enabled on OpenStack infrastructure (openstack_project::zuul).

Change-Id: I24111ba4b20ab3d5198fdf7deaf902485260d8a5
Reviewed-on: https://review.openstack.org/16475
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-23 21:57:31 +00:00

119 lines
2.5 KiB
Puppet

# == Class: zuul
class zuul (
$jenkins_server,
$jenkins_user,
$jenkins_apikey,
$gerrit_server,
$gerrit_user,
$url_pattern,
$status_url = "https://${::fqdn}/zuul/status",
$git_source_repo = 'https://github.com/openstack-ci/zuul.git',
$push_change_refs = false
) {
$packages = [
'python-webob',
'python-daemon',
'python-lockfile',
'python-paramiko',
'python-paste',
]
package { $packages:
ensure => present,
}
# A lot of things need yaml, be conservative requiring this package to avoid
# conflicts with other modules.
if ! defined(Package['python-yaml']) {
package { 'python-yaml':
ensure => present,
}
}
# Packages that need to be installed from pip
$pip_packages = ['GitPython']
package { $pip_packages:
ensure => latest, # we want the latest from these
provider => pip,
require => Class['pip'],
}
vcsrepo { '/opt/zuul':
ensure => latest,
provider => git,
revision => 'master',
source => $git_source_repo,
}
exec { 'install_zuul' :
command => 'python setup.py install',
cwd => '/opt/zuul',
path => '/bin:/usr/bin',
refreshonly => true,
subscribe => Vcsrepo['/opt/zuul'],
}
file { '/etc/zuul':
ensure => directory,
}
# 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 => 'jenkins',
mode => '0400',
content => template('zuul/zuul.conf.erb'),
require => [
File['/etc/zuul'],
Package['jenkins'],
],
}
file { '/var/log/zuul':
ensure => directory,
owner => 'jenkins',
require => Package['jenkins'],
}
file { '/var/run/zuul':
ensure => directory,
owner => 'jenkins',
require => Package['jenkins'],
}
file { '/var/lib/zuul':
ensure => directory,
owner => 'jenkins',
require => Package['jenkins'],
}
file { '/var/lib/zuul/git':
ensure => directory,
owner => 'jenkins',
require => Package['jenkins'],
}
file { '/etc/init.d/zuul/':
ensure => present,
owner => 'root',
group => 'root',
mode => '0555',
source => 'puppet:///modules/zuul/zuul.init',
}
exec { 'zuul-reload':
command => '/etc/init.d/zuul reload',
require => File['/etc/init.d/zuul'],
refreshonly => true,
}
service { 'zuul':
name => 'zuul',
enable => true,
hasrestart => true,
require => File['/etc/init.d/zuul'],
}
}