system-config/modules/jenkins/manifests/cgroups.pp
Jeremy Stanley 89a92bfb3d Fedora cgroups support.
* modules/jenkins/manifests/cgroups.pp
* modules/jenkins/manifests/params.pp: Fedora separates the cgroups
management utilities into an additional package.

* modules/jenkins/templates/cgconfig.erb: Fedora already automounts
cgroups subsystems. Also, because of Red Hat bug 918951, swap
management doesn't work in Fedora 18.

Change-Id: I2366261d64c11fdc8e65a39481e8db9d589ca2de
Reviewed-on: https://review.openstack.org/34083
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-06-26 13:59:57 +00:00

97 lines
2.2 KiB
Puppet

# == Class: jenkins::cgroups
#
class jenkins::cgroups {
include jenkins::params
if ($::jenkins::params::cgroups_tools_package != '') {
package { 'cgroups-tools':
ensure => present,
name => $::jenkins::params::cgroups_tools_package,
}
}
package { 'cgroups':
ensure => present,
name => $::jenkins::params::cgroups_package,
}
file { '/etc/cgconfig.conf':
ensure => present,
replace => true,
owner => 'root',
group => 'jenkins',
mode => '0644',
content => template('jenkins/cgconfig.erb'),
}
file { '/etc/cgrules.conf':
ensure => present,
replace => true,
owner => 'root',
group => 'jenkins',
mode => '0644',
source => 'puppet:///modules/jenkins/cgroups/cgrules.conf',
}
# Starting with Ubuntu Quantal (12.10) cgroup-bin dropped its upstart jobs.
if $::osfamily == 'Debian' {
if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease >= '12.10' {
file { '/etc/init/cgconfig.conf':
ensure => present,
replace => true,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/jenkins/cgroups/upstart_cgconfig',
}
file { '/etc/init.d/cgconfig':
ensure => link,
target => '/lib/init/upstart-job',
}
file { '/etc/init/cgred.conf':
ensure => present,
replace => true,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/jenkins/cgroups/upstart_cgred',
}
file { '/etc/init.d/cgred':
ensure => link,
target => '/lib/init/upstart-job',
}
} else {
file { '/etc/init/cgconfig.conf':
ensure => present,
}
file { '/etc/init/cgred.conf':
ensure => present,
}
}
}
service { 'cgconfig':
ensure => running,
enable => true,
require => $::jenkins::params::cgconfig_require,
subscribe => File['/etc/cgconfig.conf'],
}
service { 'cgred':
ensure => running,
enable => true,
require => $::jenkins::params::cgred_require,
subscribe => File['/etc/cgrules.conf'],
}
}