system-config/modules/openstack_project/manifests/slave_common.pp
Jeremy Stanley 314c56b3d8 Stop building py3k-precise nodes
The special py3k-precise nodes are no longer needed by any jobs, so
stop building them and clean up any custom Puppet related to them.

Change-Id: I40d5d09f28ef53583d239d2e852e9c50b5962cf8
Depends-On: Ie105674833e0a527f990a7448855a1090f5dc651
2015-01-30 17:33:40 +00:00

112 lines
2.9 KiB
Puppet

# == Class: openstack_project::slave_common
#
# Common configuration between openstack_project::slave and
# openstack_project::single_use_slave
class openstack_project::slave_common(
$sudo = false,
$project_config_repo = '',
){
vcsrepo { '/opt/requirements':
ensure => latest,
provider => git,
revision => 'master',
source => 'https://git.openstack.org/openstack/requirements',
}
class { 'project_config':
url => $project_config_repo,
}
file { '/usr/local/jenkins/slave_scripts':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
recurse => true,
purge => true,
force => true,
require => [File['/usr/local/jenkins'],
$::project_config::config_dir],
source => $::project_config::jenkins_scripts_dir,
}
file { '/home/jenkins/.pydistutils.cfg':
ensure => present,
owner => 'jenkins',
group => 'jenkins',
mode => '0644',
source => 'puppet:///modules/openstack_project/pydistutils.cfg',
require => Class['jenkins::slave'],
}
file { '/home/jenkins/.pip/pip.conf':
ensure => present,
owner => 'jenkins',
group => 'jenkins',
mode => '0644',
source => 'puppet:///modules/openstack_project/pip.conf',
require => Class['jenkins::slave'],
}
if ($sudo == true) {
file { '/etc/sudoers.d/jenkins-sudo':
ensure => present,
source => 'puppet:///modules/openstack_project/jenkins-sudo.sudo',
owner => 'root',
group => 'root',
mode => '0440',
}
}
file { '/etc/sudoers.d/jenkins-sudo-grep':
ensure => present,
source => 'puppet:///modules/openstack_project/jenkins-sudo-grep.sudo',
owner => 'root',
group => 'root',
mode => '0440',
}
# Temporary for debugging glance launch problem
# https://lists.launchpad.net/openstack/msg13381.html
# NOTE(dprince): ubuntu only as RHEL6 doesn't have sysctl.d yet
if ($::osfamily == 'Debian') {
file { '/etc/sysctl.d/10-ptrace.conf':
ensure => present,
source => 'puppet:///modules/jenkins/10-ptrace.conf',
owner => 'root',
group => 'root',
mode => '0444',
}
exec { 'ptrace sysctl':
subscribe => File['/etc/sysctl.d/10-ptrace.conf'],
refreshonly => true,
command => '/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf',
}
}
# install linux-headers depending on OS version
case $::osfamily {
'RedHat': {
$header_packages = ['kernel-devel', 'kernel-headers']
}
'Debian': {
if ($::operatingsystem == 'Debian') {
# install depending on kernel release
$header_packages = [ "linux-headers-${::kernelrelease}", ]
}
else {
$header_packages = ['linux-headers-virtual', 'linux-headers-generic']
}
}
default: {
fail("Unsupported osfamily: ${::osfamily}.")
}
}
package { $header_packages:
ensure => present
}
}