Use facter's osfamily instead of operatingsystem.

The osfamily fact is more flexible when we want to support more
GNU/Linux distributions while avoiding unnecessary code duplication.

Change-Id: Iea4c73c19e7f94df8daccf25c764b6a4539a1ea0
Reviewed-on: https://review.openstack.org/27400
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 03:32:06 +00:00 committed by Jenkins
parent 669eb287c9
commit 3089973311
11 changed files with 14 additions and 14 deletions

View File

@ -28,9 +28,9 @@ class jenkins::cgroups {
}
# Starting with Ubuntu Quantal (12.10) cgroup-bin dropped its upstart jobs.
if $::operatingsystem == 'Ubuntu' {
if $::osfamily == 'Debian' {
if $::operatingsystemrelease >= '12.10' {
if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease >= '12.10' {
file { '/etc/init/cgconfig.conf':
ensure => present,

View File

@ -69,7 +69,7 @@ class jenkins::jenkinsuser(
}
#NOTE: not all distributions have default bash files in /etc/skel
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
file { '/home/jenkins/.bashrc':
ensure => present,

View File

@ -289,7 +289,7 @@ class jenkins::slave(
# 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 ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
file { '/etc/sysctl.d/10-ptrace.conf':
ensure => present,

View File

@ -3,7 +3,7 @@
class openstack_project::automatic_upgrades (
) {
if $::operatingsystem == 'Ubuntu' {
if $::osfamily == 'Debian' {
include unattended_upgrades
}

View File

@ -4,7 +4,7 @@ class openstack_project::base(
$certname = $::fqdn,
$install_users = true
) {
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
include apt
}
include openstack_project::params
@ -56,7 +56,7 @@ class openstack_project::base(
}
# Use upstream puppet and pin to version 2.7.*
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',

View File

@ -18,8 +18,8 @@ class openstack_project::server (
sysadmin => $sysadmins,
}
# Custom rsyslog config to disable /dev/xconsole noise on Ubuntu servers
if $::operatingsystem == 'Ubuntu' {
# Custom rsyslog config to disable /dev/xconsole noise on Debuntu servers
if $::osfamily == 'Debian' {
file { '/etc/rsyslog.d/50-default.conf':
ensure => present,
owner => 'root',

View File

@ -3,7 +3,7 @@
class openstack_project::tmpcleanup (
) {
if $::operatingsystem == 'Ubuntu' {
if $::osfamily == 'Debian' {
include tmpreaper
}

View File

@ -4,7 +4,7 @@ class salt (
$salt_master = $::fqdn
) {
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
include apt
# Wrap in ! defined checks to allow minion and master installs on the

View File

@ -2,7 +2,7 @@
#
class salt::master {
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
include apt
# Wrap in ! defined checks to allow minion and master installs on the

View File

@ -14,7 +14,7 @@ class snmpd {
require => File['/etc/snmp/snmpd.conf']
}
if ($::operatingsystem == 'Ubuntu') {
if ($::osfamily == 'Debian') {
# This file is only needed on machines pre-precise. There is a bug in
# the previous init script versions which causes them to attempt
# snmptrapd even if it's configured not to run, and then to report

View File

@ -16,7 +16,7 @@ class ssh {
group => 'root',
mode => '0444',
source => [
"puppet:///modules/ssh/sshd_config.${::operatingsystem}",
"puppet:///modules/ssh/sshd_config.${::osfamily}",
'puppet:///modules/ssh/sshd_config',
],
replace => true,