diff --git a/manifests/site.pp b/manifests/site.pp index c418351a71..ee7ce10145 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -103,7 +103,8 @@ node 'graphite.openstack.org' { graphite_admin_user => hiera('graphite_admin_user'), graphite_admin_email => hiera('graphite_admin_email'), graphite_admin_password => hiera('graphite_admin_password'), - statsd_hosts => ['jenkins.openstack.org'], + statsd_hosts => ['jenkins.openstack.org', + 'zuul.openstack.org'], } } @@ -197,6 +198,7 @@ node 'zuul.openstack.org' { zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'), url_pattern => 'http://logs.openstack.org/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}', sysadmins => hiera('sysadmins'), + statsd_host => 'graphite.openstack.org', } } diff --git a/modules/openstack_project/manifests/zuul.pp b/modules/openstack_project/manifests/zuul.pp index 5689594361..202be02017 100644 --- a/modules/openstack_project/manifests/zuul.pp +++ b/modules/openstack_project/manifests/zuul.pp @@ -10,7 +10,8 @@ class openstack_project::zuul( $gerrit_user = '', $zuul_ssh_private_key = '', $url_pattern = '', - $sysadmins = [] + $sysadmins = [], + $statsd_host = '' ) { $rules = [ "-m state --state NEW -m tcp -p tcp --dport 8001 -s ${jenkins_host} -j ACCEPT" ] diff --git a/modules/zuul/manifests/init.pp b/modules/zuul/manifests/init.pp index 81c5b08397..b075d36d4d 100644 --- a/modules/zuul/manifests/init.pp +++ b/modules/zuul/manifests/init.pp @@ -12,7 +12,8 @@ class zuul ( $url_pattern = '', $status_url = "https://${::fqdn}/", $git_source_repo = 'https://github.com/openstack-infra/zuul.git', - $push_change_refs = false + $push_change_refs = false, + $statsd_host = '' ) { include apache @@ -46,6 +47,12 @@ class zuul ( } } + package { 'statsd': + ensure => latest, # okay to use latest for pip + provider => pip, + require => Class[pip], + } + user { 'zuul': ensure => present, home => '/home/zuul', @@ -103,6 +110,12 @@ class zuul ( ], } + file { '/etc/default/zuul': + ensure => present, + mode => '0444', + content => template('zuul/zuul.default.erb'), + } + file { '/var/log/zuul': ensure => directory, owner => 'zuul', diff --git a/modules/zuul/templates/zuul.default.erb b/modules/zuul/templates/zuul.default.erb new file mode 100644 index 0000000000..e5c273285f --- /dev/null +++ b/modules/zuul/templates/zuul.default.erb @@ -0,0 +1,4 @@ +<% if scope.lookupvar("zuul::statsd_host") != "" %> +export STATSD_HOST=<%= scope.lookupvar("zuul::statsd_host") %> +export STATSD_PORT=8125 +<% end %>