Antoine Musso 87778caaee zuul can now be installed from a different git repo
$git_source_repo is a new optional parameter to the zuul class, let you
specify from which repository you want to install zuul. The default is
the maintainer version on GitHub.

The reason for this change is that some third party always hosts their
software on their own infrastructure. That is the case of the Wikimedia
Foundation which is reusing this module.

Change-Id: I5ac8852b08d158ff3531f6795855df20a204789e
Reviewed-on: https://review.openstack.org/13576
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-09-24 19:15:04 +00:00

98 lines
2.0 KiB
Puppet

class zuul (
$jenkins_server,
$jenkins_user,
$jenkins_apikey,
$gerrit_server,
$gerrit_user,
$url_pattern,
$git_source_repo='https://github.com/openstack-ci/zuul.git'
) {
$packages = ["python-webob",
"python-daemon",
"python-paste"]
package { $packages:
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":
owner => 'jenkins',
mode => 400,
ensure => 'present',
content => template('zuul/zuul.conf.erb'),
require => File["/etc/zuul"],
}
file { "/var/log/zuul":
ensure => "directory",
owner => 'jenkins'
}
file { "/var/run/zuul":
ensure => "directory",
owner => 'jenkins'
}
file { "/var/lib/zuul":
ensure => "directory",
owner => 'jenkins'
}
file { "/var/lib/zuul/git":
ensure => "directory",
owner => 'jenkins'
}
file { "/etc/init.d/zuul/":
owner => 'root',
group => 'root',
mode => 555,
ensure => 'present',
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'],
}
}