Updates to the cgroups manifest to work on RHEL.

Add a new cgroup package parameter.

Update the cgroups.pp manifest to use the package params.

Also, updates the cgconfig.erb template to support Red Hat which
has slightly different cgroup mounts than Ubuntu.

Change-Id: I9bf34c93fe987c085040929ab16d5a5f5406ad47
Reviewed-on: https://review.openstack.org/18999
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Dan Prince 2013-01-04 14:16:06 -05:00 committed by Jenkins
parent 2ba9ef9b27
commit f2058ced8e
3 changed files with 23 additions and 3 deletions

View File

@ -2,8 +2,11 @@
#
class jenkins::cgroups {
package { 'cgroup-bin':
include jenkins::params
package { 'cgroups':
ensure => present,
name => $::jenkins::params::cgroups_package,
}
file { '/etc/cgconfig.conf':
@ -27,14 +30,14 @@ class jenkins::cgroups {
service { 'cgconfig':
ensure => running,
enable => true,
require => Package['cgroup-bin'],
require => Package['cgroups'],
subscribe => File['/etc/cgconfig.conf'],
}
service { 'cgred':
ensure => running,
enable => true,
require => Package['cgroup-bin'],
require => Package['cgroups'],
subscribe => File['/etc/cgrules.conf'],
}
}

View File

@ -42,6 +42,7 @@ class jenkins::params {
$unzip_package = 'unzip'
$xslt_package = 'libxslt'
$xvfb_package = 'xorg-x11-server-Xvfb'
$cgroups_package = 'libcgroup'
}
'Debian', 'Ubuntu': {
# common packages
@ -78,6 +79,7 @@ class jenkins::params {
$unzip_package = 'unzip'
$xslt_package = 'xsltproc'
$xvfb_package = 'xvfb'
$cgroups_package = 'cgroup-bin'
}
default: {
fail("Unsupported osfamily: ${::osfamily} The 'jenkins' module only supports osfamily Ubuntu or Redhat(slaves only).")

View File

@ -1,3 +1,17 @@
<% if osfamily == "RedHat" then %>
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
}
<% else %>
mount {
cpu = /sys/fs/cgroup/cpu;
cpuacct = /sys/fs/cgroup/cpuacct;
@ -5,6 +19,7 @@ mount {
memory = /sys/fs/cgroup/memory;
freezer = /sys/fs/cgroup/freezer;
}
<% end %>
group jenkins {
perm {