system-config/modules/openstack_project/manifests/slave_common.pp
Monty Taylor 5edaf90e60 Put the mirror config into slave_common
slave.pp is skipped for single-use slaves. Put the base mirror config
into slave_common so that it'll get picked up.

Change-Id: I4bff37ecab78264207e83eb237798ed320dfdab7
2014-07-01 10:44:37 -07:00

96 lines
2.5 KiB
Puppet

# == Class: openstack_project::slave_common
#
# Common configuration between openstack_project::slave and
# openstack_project::single_use_slave
class openstack_project::slave_common(
$include_pypy = false,
$sudo = false,
){
vcsrepo { '/opt/requirements':
ensure => latest,
provider => git,
revision => 'master',
source => 'https://git.openstack.org/openstack/requirements',
}
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'],
source => 'puppet:///modules/openstack_project/slave_scripts',
}
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',
}
if $include_pypy {
apt::ppa { 'ppa:pypy/ppa': }
package { 'pypy':
ensure => present,
require => Apt::Ppa['ppa:pypy/ppa']
}
package { 'pypy-dev':
ensure => present,
require => Apt::Ppa['ppa:pypy/ppa']
}
}
}
}