From ae3dfe4d95b17e6f2a3fec5799eb76bc737e2d84 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 24 Apr 2013 02:27:21 +0000 Subject: [PATCH] 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 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins --- install_jenkins_slave.sh | 2 +- install_puppet.sh | 2 +- manifests/site.pp | 22 +++++++++++++++++++ modules/exim/manifests/init.pp | 2 +- modules/exim/manifests/params.pp | 2 +- modules/iptables/manifests/params.pp | 2 +- modules/jenkins/manifests/params.pp | 2 +- modules/jenkins/manifests/slave.pp | 2 +- modules/openstack_project/manifests/params.pp | 2 +- modules/pip/manifests/init.pp | 2 +- modules/pip/manifests/params.pp | 2 +- modules/snmpd/manifests/params.pp | 2 +- modules/ssh/manifests/params.pp | 2 +- modules/ulimit/manifests/params.pp | 2 +- 14 files changed, 35 insertions(+), 13 deletions(-) diff --git a/install_jenkins_slave.sh b/install_jenkins_slave.sh index 77a9afe4b6..2e29145ee6 100755 --- a/install_jenkins_slave.sh +++ b/install_jenkins_slave.sh @@ -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 diff --git a/install_puppet.sh b/install_puppet.sh index c4dbb93b5b..cba78b51b6 100755 --- a/install_puppet.sh +++ b/install_puppet.sh @@ -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 diff --git a/manifests/site.pp b/manifests/site.pp index 69bee37b2c..f378521873 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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': diff --git a/modules/exim/manifests/init.pp b/modules/exim/manifests/init.pp index 8a5e9bd461..d7fb271cb0 100644 --- a/modules/exim/manifests/init.pp +++ b/modules/exim/manifests/init.pp @@ -9,7 +9,7 @@ class exim( ensure => present, } - if ($::operatingsystem == 'Redhat') { + if ($::osfamily == 'RedHat') { service { 'postfix': ensure => stopped } diff --git a/modules/exim/manifests/params.pp b/modules/exim/manifests/params.pp index 13adb1deda..a1212a4339 100644 --- a/modules/exim/manifests/params.pp +++ b/modules/exim/manifests/params.pp @@ -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' diff --git a/modules/iptables/manifests/params.pp b/modules/iptables/manifests/params.pp index dc41a33a19..e11c7b2736 100644 --- a/modules/iptables/manifests/params.pp +++ b/modules/iptables/manifests/params.pp @@ -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' diff --git a/modules/jenkins/manifests/params.pp b/modules/jenkins/manifests/params.pp index 74df64dd52..47ce30a2b9 100644 --- a/modules/jenkins/manifests/params.pp +++ b/modules/jenkins/manifests/params.pp @@ -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' diff --git a/modules/jenkins/manifests/slave.pp b/modules/jenkins/manifests/slave.pp index 95e7197100..eeb78b57c1 100644 --- a/modules/jenkins/manifests/slave.pp +++ b/modules/jenkins/manifests/slave.pp @@ -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"', diff --git a/modules/openstack_project/manifests/params.pp b/modules/openstack_project/manifests/params.pp index 345e6d1628..5ec7b6459e 100644 --- a/modules/openstack_project/manifests/params.pp +++ b/modules/openstack_project/manifests/params.pp @@ -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 = '' diff --git a/modules/pip/manifests/init.pp b/modules/pip/manifests/init.pp index 461e29c78b..7103de0157 100644 --- a/modules/pip/manifests/init.pp +++ b/modules/pip/manifests/init.pp @@ -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', diff --git a/modules/pip/manifests/params.pp b/modules/pip/manifests/params.pp index 5acb02cca5..c580feba41 100644 --- a/modules/pip/manifests/params.pp +++ b/modules/pip/manifests/params.pp @@ -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' } diff --git a/modules/snmpd/manifests/params.pp b/modules/snmpd/manifests/params.pp index 0808467bf1..fe2452f918 100644 --- a/modules/snmpd/manifests/params.pp +++ b/modules/snmpd/manifests/params.pp @@ -4,7 +4,7 @@ # accessed by other classes. class snmpd::params { case $::osfamily { - 'Redhat': { + 'RedHat': { $package_name = 'net-snmp' } 'Debian', 'Ubuntu': { diff --git a/modules/ssh/manifests/params.pp b/modules/ssh/manifests/params.pp index 355bb32995..52c13b29f2 100644 --- a/modules/ssh/manifests/params.pp +++ b/modules/ssh/manifests/params.pp @@ -4,7 +4,7 @@ # accessed by other classes. class ssh::params { case $::osfamily { - 'Redhat': { + 'RedHat': { $package_name = 'openssh-server' $service_name = 'sshd' } diff --git a/modules/ulimit/manifests/params.pp b/modules/ulimit/manifests/params.pp index b0c5eabb86..0ee23a22d4 100644 --- a/modules/ulimit/manifests/params.pp +++ b/modules/ulimit/manifests/params.pp @@ -4,7 +4,7 @@ # accessed by other classes. class ulimit::params { case $::osfamily { - 'Fedora', 'Redhat': { + 'RedHat': { $pam_packages = ['pam'] } 'Debian', 'Ubuntu': {