Jenkins slave puppetry for CentOS.

The install scripts now look for CentOS in release files. Also some
instances of facter's operatingsystem are switched to osfamily and
capitalization of RedHat is normalized to match what facter uses.

Change-Id: I3bbca5481d0d5e6de9e62bfd6e2b0a85264ed6ed
Reviewed-on: https://review.openstack.org/27398
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
This commit is contained in:
Jeremy Stanley 2013-04-24 02:27:21 +00:00 committed by Jenkins
parent 901e706aea
commit ae3dfe4d95
14 changed files with 35 additions and 13 deletions

View File

@ -5,7 +5,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
if cat /etc/*release | grep "Red Hat" &> /dev/null; then
if cat /etc/*release | grep -e "CentOS" -e "Red Hat" &> /dev/null; then
rpm -qi epel-release &> /dev/null || rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#installing this package gives use the key

View File

@ -20,7 +20,7 @@
# The repo and preferences files are also managed by puppet, so be sure
# to keep them in sync with this file.
if cat /etc/*release | grep "Red Hat" &> /dev/null; then
if cat /etc/*release | grep -e "CentOS" -e "Red Hat" &> /dev/null; then
rpm -qi epel-release &> /dev/null || rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm

View File

@ -348,6 +348,28 @@ node /^oneiric.*\.slave\.openstack\.org$/ {
}
node /^centos6.*\.slave\.openstack\.org$/ {
include openstack_project::puppet_cron
class { 'openstack_project::slave':
certname => 'centos6.slave.openstack.org',
sysadmins => hiera('sysadmins'),
}
file { '/home/jenkins/.config/glance':
ensure => absent,
force => true,
recurse => true,
}
include jenkins::cgroups
include ulimit
ulimit::conf { 'limit_jenkins_procs':
limit_domain => 'jenkins',
limit_type => 'hard',
limit_item => 'nproc',
limit_value => '256'
}
}
node /^rhel6.*\.slave\.openstack\.org$/ {
include openstack_project::puppet_cron
class { 'openstack_project::slave':

View File

@ -9,7 +9,7 @@ class exim(
ensure => present,
}
if ($::operatingsystem == 'Redhat') {
if ($::osfamily == 'RedHat') {
service { 'postfix':
ensure => stopped
}

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class exim::params {
case $::osfamily {
'Redhat': {
'RedHat': {
$package = 'exim'
$service_name = 'exim'
$config_file = '/etc/exim/exim.conf'

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class iptables::params {
case $::osfamily {
'Redhat': {
'RedHat': {
$package_name = 'iptables'
$service_name = 'iptables'
$rules_dir = '/etc/sysconfig'

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class jenkins::params {
case $::osfamily {
'Redhat': {
'RedHat': {
#yum groupinstall "Development Tools"
# common packages
$jdk_package = 'java-1.7.0-openjdk'

View File

@ -66,7 +66,7 @@ class jenkins::slave(
ensure => present,
}
if ($::operatingsystem == 'Redhat') {
if ($::osfamily == 'RedHat') {
exec { 'yum Group Install':
unless => '/usr/bin/yum grouplist "Development tools" | /bin/grep "^Installed Groups"',

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class openstack_project::params {
case $::osfamily {
'Redhat': {
'RedHat': {
$packages = ['puppet', 'python-setuptools', 'wget']
$user_packages = ['byobu', 'emacs-nox']
$update_pkg_list_cmd = ''

View File

@ -12,7 +12,7 @@ class pip {
require => Package[$::pip::params::python_devel_package]
}
if ($::operatingsystem == 'Redhat' or $::operatingsystem == 'Fedora') {
if ($::osfamily == 'RedHat') {
file { '/usr/bin/pip':
ensure => 'link',

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class pip::params {
case $::osfamily {
'Fedora', 'Redhat': {
'RedHat': {
$python_devel_package = 'python-devel'
$python_pip_package = 'python-pip'
}

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class snmpd::params {
case $::osfamily {
'Redhat': {
'RedHat': {
$package_name = 'net-snmp'
}
'Debian', 'Ubuntu': {

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class ssh::params {
case $::osfamily {
'Redhat': {
'RedHat': {
$package_name = 'openssh-server'
$service_name = 'sshd'
}

View File

@ -4,7 +4,7 @@
# accessed by other classes.
class ulimit::params {
case $::osfamily {
'Fedora', 'Redhat': {
'RedHat': {
$pam_packages = ['pam']
}
'Debian', 'Ubuntu': {