Clark Boylan 81e77fc27a Fix the zuul reloading on config changes.
Zuul config files were broken out into a new module which introduced
cross module subscription dependencies. To make this work the module
doing the notify/subscribe must include the module the resource that
the subscription/notify is on. To fix this have config files notify
the zuul_reload exec.

Change-Id: I2d9e2236bc378d9dd92f811830dee6540b4cf4e2
2012-07-27 17:10:46 -07:00

77 lines
1.5 KiB
Puppet

class zuul ()
{
$packages = ["python-webob",
"python-daemon",
"python-paste"]
package { $packages:
ensure => "present",
}
# if we already have the repo the pull updates
exec { "update_zuul":
command => "git pull --ff-only",
cwd => "/opt/zuul",
path => "/bin:/usr/bin",
onlyif => "test -d /opt/zuul",
before => Exec["get_zuul"],
}
# otherwise get a new clone of it
exec { "get_zuul":
command => "git clone https://github.com/openstack-ci/zuul /opt/zuul",
path => "/bin:/usr/bin",
onlyif => "test ! -d /opt/zuul"
}
exec { "install_zuul":
command => "python setup.py install",
cwd => "/opt/zuul",
path => "/bin:/usr/bin",
subscribe => [ Exec["get_zuul"], Exec["update_zuul"] ],
}
file { "/etc/zuul":
ensure => "directory",
}
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 { "/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'],
}
}