diff --git a/manifests/cron.pp b/manifests/cron.pp index d0df03d5947aba5e3e132ad63fa5ee3fc94f7f0d..e8a343aa45902e35dc42e9e029c65b309e07c896 100644 --- a/manifests/cron.pp +++ b/manifests/cron.pp @@ -25,7 +25,7 @@ class base::cron( } elsif ($::osfamily == 'RedHat') { $crond = 'crond' - if ($::lsbmajdistrelease == '6') { + if ($lsbmajdistrelease == '6') { # OL6 appears to be stuck with cronie-anacron if ($::operatingsystem == 'OracleLinux') { package { 'cronie-anacron': ensure => present } diff --git a/manifests/ipmi.pp b/manifests/ipmi.pp index 8f278353793e7d7d41b95b8355664214c2bd857c..12f46dc42f4593b36b1d1b44ec2c9117899eda9e 100644 --- a/manifests/ipmi.pp +++ b/manifests/ipmi.pp @@ -51,10 +51,7 @@ class base::ipmi ( # default. But, if we are re-enabling we need to recover a file that # we deleted. We then have to trigger systemd to load modules. # - # Note: we add 0 to $::lsbmajdistrelease to make the numerical - # comparison work (this way, the code works in both Puppet 3 and - # Puppet 4). - if (($::operatingsystem == 'Debian') and (0 + $::lsbmajdistrelease >= 8)) { + if (($::operatingsystem == 'Debian') and (Integer($lsbmajdistrelease) >= 8)) { exec { 'Re-create /usr/lib/modules-load.d/ipmievd.conf': command => '/usr/bin/apt-get install --reinstall ipmitool', creates => '/usr/lib/modules-load.d/ipmievd.conf', @@ -132,7 +129,7 @@ class base::ipmi ( } # For RHEL 5 and earlier, the client is a separate package - if $::lsbmajdistrelease <= 5 { + if Integer($lsbmajdistrelease) <= 5 { package { 'OpenIPMI-tools': ensure => present, } @@ -233,7 +230,7 @@ class base::ipmi ( } # For Debian 8+, make sure modules are not re-loaded on startup - if $::operatingsystem == 'Debian' and $::lsbmajdistrelease >= 8 { + if $::operatingsystem == 'Debian' and Integer($lsbmajdistrelease) >= 8 { file { '/usr/lib/modules-load.d/ipmievd.conf': ensure => absent, } diff --git a/manifests/ntp.pp b/manifests/ntp.pp index 0b4a6c9553f844bb068a2ebb4be3c24ee566f8d6..ee96cbfea5c52a55bc4b6573440f87fe72766730 100644 --- a/manifests/ntp.pp +++ b/manifests/ntp.pp @@ -38,9 +38,9 @@ class base::ntp { }, notify => Service['ntpd'], } - # On RHEL 8, we expect that systemd-timesync will be present, and not + # On RHEL 8, we expect that systemd-timesync will be present, and not # masked by NTP's installation. So, disbale the service. - if ( $::lsbmajdistrelease == 8 ) { + if ( Integer($lsbmajdistrelease) == 8 ) { service { 'systemd-timesyncd': ensure => stopped, enable => false, diff --git a/manifests/os/centos.pp b/manifests/os/centos.pp index 2ebbb6c74b4f5616a79297c17e044ced3f889a13..52dbbf7de9571cde5301c7183482147c5fc803a5 100644 --- a/manifests/os/centos.pp +++ b/manifests/os/centos.pp @@ -1,6 +1,6 @@ # # Rules specific to CentOS systems. Very thin class because with -# minor edits to redhat.pp, little additional config is needed +# minor edits to redhat.pp, little additional config is needed class base::os::centos { # redhat.pp can handle most of the heavy lifting for CentOS @@ -31,8 +31,8 @@ class base::os::centos { # CentOS repo rpm gpg key base::rpm::import { 'centos-rpmkey': - url => "/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${::lsbmajdistrelease}", - signature => $::lsbmajdistrelease ? { + url => "/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-${lsbmajdistrelease}", + signature => $lsbmajdistrelease ? { '5' => 'gpg-pubkey-e8562897-459f07a4', '6' => 'gpg-pubkey-c105b9de-4e0fd3a3', '7' => 'gpg-pubkey-f4a80eb5-53a7ff4b', diff --git a/manifests/os/redhat.pp b/manifests/os/redhat.pp index 2d4d64a63998f2d3fb1d7226d4055fbae5ef2562..42f11d95f2f40bbed183f5f39858cca7dad9550d 100644 --- a/manifests/os/redhat.pp +++ b/manifests/os/redhat.pp @@ -33,7 +33,7 @@ class base::os::redhat { } # RHEL RPM GPG Key stuff - case $::lsbmajdistrelease { + case $lsbmajdistrelease { # RHEL4 '4': { # CentOS repo handled in centos.pp @@ -56,13 +56,13 @@ class base::os::redhat { if ($::operatingsystem == 'RedHat') { base::rpm::import { 'redhat-rpmkey': url => '/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release', - signature => $::lsbmajdistrelease ? { + signature => $lsbmajdistrelease ? { '5' => 'gpg-pubkey-37017186-45761324', '6' => 'gpg-pubkey-fd431d51-4ae0493b', }; } } - if ($::lsbmajdistrelease != '7') { + if ($lsbmajdistrelease != '7') { base::rpm::import { 'dag-rpmkey': url => '/usr/share/doc/rpmforge-release-0.3.6/RPM-GPG-KEY-rpmforge-dag', @@ -76,12 +76,12 @@ class base::os::redhat { } # EL7 has its own class - if ($::lsbmajdistrelease == '7') { + if ($lsbmajdistrelease == '7') { include base::os::redhat::el7 } # RHEL4 and 5 need links to krb utils - case $::lsbmajdistrelease { + case $lsbmajdistrelease { '4','5': { file { '/usr/bin/kinit': diff --git a/manifests/os/redhat/el7.pp b/manifests/os/redhat/el7.pp index 797570d490a02916bcf6f90cfbc6edc547ab8403..aaf3b56d481b633cce27c88253d813721be96f0e 100644 --- a/manifests/os/redhat/el7.pp +++ b/manifests/os/redhat/el7.pp @@ -5,7 +5,7 @@ # - Disable firewalld in favor of iptables class base::os::redhat::el7 { - if ($::lsbmajdistrelease == '7') { + if ($lsbmajdistrelease == '7') { # dependencies to run the stanford-* tools $el7_deps = [ 'perl-Config-Simple', 'perl-Crypt-PasswdMD5', @@ -23,7 +23,7 @@ class base::os::redhat::el7 { # remove versions of AFS cell configs installed by openafs-* # Due to an encoding 'bug' in Puppet, Puppet cannot checksum the AFS - # cell configs provided by openafs* because Puppet encodes via ASCII + # cell configs provided by openafs* because Puppet encodes via ASCII # and chokes on a unicode character in the provided file exec { 'workaround_bytelock_afs_error': path => "/usr/bin:/usr/sbin:/bin:/sbin", @@ -86,5 +86,5 @@ and all contents are provided by modules/base/os/redhat/el7.pp. Removing files in this directory will trigger restarts of critical system services.\n", } - } + } } diff --git a/manifests/os/redhat/syslog.pp b/manifests/os/redhat/syslog.pp index 9ac73a6620374f1942bc7eb8559545f5035786b1..55e8eacfd9f4dc4f1ced8491b5bee1ed63f34ce8 100644 --- a/manifests/os/redhat/syslog.pp +++ b/manifests/os/redhat/syslog.pp @@ -1,4 +1,4 @@ -# Since some production RHEL6 hosts (e.g. zm01) have +# Since some production RHEL6 hosts (e.g. zm01) have # overrides to the syslog.conf file, that part of this # class is being left commented out for now. # @@ -13,19 +13,19 @@ class base::os::redhat::syslog inherits base::syslog { # assuming only affected on RHEL6 for now - if ($::lsbmajdistrelease == '6') { + if ($lsbmajdistrelease == '6') { Base::Syslog::Config::Rsyslog['/etc/rsyslog.conf'] { use_v5 => 'true', use_syslog_conf => 'true', use_default => 'false', } - + # if these files happen to be present, rsyslog will really # complain upon restart $rsyslog_files = [ '/etc/rsyslog.d/20-templates.conf', '/etc/rsyslog.d/95-default.conf', '/etc/rsyslog.d/postfix.conf' ] - file { $rsyslog_files: ensure => absent } + file { $rsyslog_files: ensure => absent } # uncomment to enforce a 'sane' global syslog.conf #Base::Syslog::Config::Syslog['/etc/syslog.conf'] { diff --git a/manifests/os/ubuntu.pp b/manifests/os/ubuntu.pp index 79760b870b2f89e9e0ff67ebdbf0f392dcf07360..5a4d1a71db50572c5b75c956069ce775ce71b552 100644 --- a/manifests/os/ubuntu.pp +++ b/manifests/os/ubuntu.pp @@ -11,7 +11,7 @@ class base::os::ubuntu inherits base::os::debian { } # Triggered on Ubuntu to start the supervise process. Only on 14.10 and below. - if ($::lsbmajdistrelease < 15) { + if (Integer($lsbmajdistrelease) < 15) { include base::daemontools file { '/etc/init/supervise.conf': diff --git a/manifests/pam/debian.pp b/manifests/pam/debian.pp index 90f642340f2bf5a9809cecec55010eb25b7c83a2..3dff911523f61be9aa1c471814fee2d454711141 100644 --- a/manifests/pam/debian.pp +++ b/manifests/pam/debian.pp @@ -10,7 +10,7 @@ class base::pam::debian( package { 'libpam-afs-session': ensure => present } # Starting with Debian jessie, pam-auth-update manages the common PAM files. - if ($::lsbmajdistrelease < 8) { + if (Integer($lsbmajdistrelease) < 8) { file { '/etc/pam.d/common-auth': source => 'puppet:///modules/base/pam/etc/pam.d/common-auth', @@ -30,7 +30,7 @@ class base::pam::debian( package { 'libpam-afs-session': ensure => absent } # Starting with Debian jessie, pam-auth-update manages the common PAM files. - if ($::lsbmajdistrelease < 8) { + if (Integer($lsbmajdistrelease) < 8) { file { '/etc/pam.d/common-auth': ensure => absent } diff --git a/manifests/portmap.pp b/manifests/portmap.pp index 771c7bda874b8a94c1a769b12076b8cb51b208c4..b624928c45c5a85c8d8034c29078ca3db1131e19 100644 --- a/manifests/portmap.pp +++ b/manifests/portmap.pp @@ -11,7 +11,7 @@ class base::portmap { 'RedHat': { include base::xinetd - case $::lsbmajdistrelease { + case $lsbmajdistrelease { '6','7': { package { 'rpcbind': ensure => present } service { 'rpcbind': ensure => running } @@ -37,7 +37,7 @@ class base::portmap { # Ubuntu 11.10 switched to "rpcbind" like EL6 package { 'rpcbind': ensure => present } service { 'portmap': ensure => running } - } else { + } else { case $::lsbdistcodename { 'squeeze': { package { 'portmap': ensure => present } diff --git a/manifests/rpm.pp b/manifests/rpm.pp index 4f565e7c0670ce6a071823c12c00dbe8057bfaa5..e2ed0bb152cc2d5385f7cd5798187b18b6ee4578 100644 --- a/manifests/rpm.pp +++ b/manifests/rpm.pp @@ -18,12 +18,12 @@ class base::rpm::openafs { '4' => '1.6.2', default => '1.6.5', } - base::rpm::yumrepo { "openafs-${openafsver}-EL${::lsbmajdistrelease}.repo": } + base::rpm::yumrepo { "openafs-${openafsver}-EL${lsbmajdistrelease}.repo": } } # rpm class. applied to every RHEL system via basenode (os module) class base::rpm { - + case $::osfamily { 'RedHat': { include base::rpm::openafs @@ -38,9 +38,9 @@ class base::rpm { } # Apply to all RHEL releases - base::rpm::yumrepo { "dag-EL${::lsbmajdistrelease}.repo": } - base::rpm::yumrepo { "stanford-priv-EL${::lsbmajdistrelease}.repo": } - base::rpm::yumrepo { "stanford-EL${::lsbmajdistrelease}.repo": } + base::rpm::yumrepo { "dag-EL${lsbmajdistrelease}.repo": } + base::rpm::yumrepo { "stanford-priv-EL${lsbmajdistrelease}.repo": } + base::rpm::yumrepo { "stanford-EL${lsbmajdistrelease}.repo": } # puppetlabs repo now being mirrored on yum.stanford.edu file { '/etc/yum.repos.d/puppet-mirror.repo': ensure => present, @@ -58,7 +58,7 @@ class base::rpm { require => Package['newsyslog']; } - case $::lsbmajdistrelease { + case $lsbmajdistrelease { # RHEL4 '4': { include base::up2date @@ -68,9 +68,9 @@ class base::rpm { } # RHEL5+ default: { - # EL6/7 includes this plugin by default - if ($::lsbmajdistrelease == '5') { - package { 'yum-downloadonly': + # EL6/7 includes this plugin by default + if ($lsbmajdistrelease == '5') { + package { 'yum-downloadonly': ensure => installed, } } @@ -99,7 +99,7 @@ class base::rpm { } # only RHEL4 and RHEL5 use rpmpkgs log - if ($::lsbmajdistrelease == '4' or $::lsbmajdistrelease == '5') { + if ($lsbmajdistrelease == '4' or $lsbmajdistrelease == '5') { # rotate /var/log/rpmpkgs weekly file { '/etc/newsyslog.weekly/rpmpkgs': source => 'puppet:///modules/base/rpm/etc/newsyslog.weekly/rpmpkgs', diff --git a/manifests/ssh/hostbased.pp b/manifests/ssh/hostbased.pp index 80ad9456f3b5623e67326166ef4c2a5efaf27a86..0443ac1c6132d8b7645314efb2ee3f0d25d77889 100644 --- a/manifests/ssh/hostbased.pp +++ b/manifests/ssh/hostbased.pp @@ -3,7 +3,7 @@ # authentication.) class base::ssh::hostbased inherits base::ssh::pubkey { - if ($::osfamily == 'RedHat') and ($::lsbmajdistrelease >= 6) { + if ($::osfamily == 'RedHat') and (Integer($lsbmajdistrelease) >= 6) { fail("ssh::new::hostbased should not be used with RHEL 6 or later") } diff --git a/manifests/ssh/package.pp b/manifests/ssh/package.pp index 3ee336350a017ad78b76895806f5901902cf3b2f..b634ac869376bb5795e081f56d97d059a6b6cc2c 100644 --- a/manifests/ssh/package.pp +++ b/manifests/ssh/package.pp @@ -12,10 +12,10 @@ class base::ssh::package ( $sshd_package = 'openssh-server' # Debian wheezy is the oldest supported version - if ($::lsbmajdistrelease < 7) { + if (Integer($lsbmajdistrelease) < 7) { fail('pam_duo requires at least Debian wheezy') } - elsif ($::lsbmajdistrelease == 7) { + elsif (Integer($lsbmajdistrelease) == 7) { # On wheezy, pin the backported openssh file { '/etc/apt/preferences.d/openssh': ensure => present, @@ -28,7 +28,7 @@ class base::ssh::package ( $sshd_package = 'openssh-server' # Ubuntu trusty is the oldest supported version - if ($::lsbmajdistrelease < 14) { + if (Integer($lsbmajdistrelease) < 14) { fail('pam_duo requires at least Ubuntu trusty') } } @@ -39,7 +39,7 @@ class base::ssh::package ( $sshd_package = 'openssh-server' # RHEL/CentOS 7 is the oldest supported version - if ($::lsbmajdistrelease < 7) { + if (Integer($lsbmajdistrelease) < 7) { fail('pam_duo requires at least RHEL/CentOS 7') } } diff --git a/manifests/syslog.pp b/manifests/syslog.pp index e6a51153e68d355d65cb0db600d077d01b46109e..73dc2ff4c95f1be3560e11da6aae624f4bcd5568 100644 --- a/manifests/syslog.pp +++ b/manifests/syslog.pp @@ -44,7 +44,7 @@ class base::syslog( } # RHEL4/5 are ancient and use syslog, everything modern uses rsyslog - if ( $::osfamily == 'RedHat' and $::lsbmajdistrelease < 6 ) { + if ( $::osfamily == 'RedHat' and Integer($lsbmajdistrelease) < 6 ) { service { 'syslog': ensure => running } } else { file { '/etc/rsyslog.d': diff --git a/manifests/vmguest.pp b/manifests/vmguest.pp index 744ee89e25c8f0533691a5b754d7a8052e43e748..6b451e7ebc83aaaf2417471ace19cbcacc1d7581 100644 --- a/manifests/vmguest.pp +++ b/manifests/vmguest.pp @@ -46,8 +46,8 @@ class base::vmguest( # we do not the rebundled version by this name package { 'VMwareTools': ensure => absent } # VMWare recommends open-vm-tools for EL7 - if ($::lsbmajdistrelease != '7') { - base::rpm::yumrepo { "vmware-tools-EL${::lsbmajdistrelease}.repo": } + if ($lsbmajdistrelease != '7') { + base::rpm::yumrepo { "vmware-tools-EL${lsbmajdistrelease}.repo": } base::rpm::import { 'vmware-tools-dsa': url => @@ -61,7 +61,7 @@ class base::vmguest( package { 'vmware-tools-esx-nox': ensure => present, require => [ - Base::Rpm::Yumrepo["vmware-tools-EL${::lsbmajdistrelease}.repo"], + Base::Rpm::Yumrepo["vmware-tools-EL${lsbmajdistrelease}.repo"], Base::Rpm::Import['vmware-tools-dsa'], Base::Rpm::Import['vmware-tools-rsa'], Package['VMwareTools'] diff --git a/manifests/xinetd/service.pp b/manifests/xinetd/service.pp index 00e55a7ad8c93f0102940919812bb85ec230602e..64abf0cdfd5661bc69af219edb43a5f9fd95d234 100644 --- a/manifests/xinetd/service.pp +++ b/manifests/xinetd/service.pp @@ -12,7 +12,7 @@ define base::xinetd::service( # Used for the file suffix. case $::osfamily { Debian: { $os = $::osfamily } - RedHat: { $os = "${::operatingsystem}${::lsbmajdistrelease}" } + RedHat: { $os = "${::operatingsystem}${lsbmajdistrelease}" } } case $ensure { diff --git a/manifests/yumtools/yum_puppet_lock.pp b/manifests/yumtools/yum_puppet_lock.pp index 3d5a12ad855c6ccd65841abb7ae52fd32dcc6ecb..62740e5e873e7aebf751807203ed190470bf1f3c 100644 --- a/manifests/yumtools/yum_puppet_lock.pp +++ b/manifests/yumtools/yum_puppet_lock.pp @@ -7,11 +7,11 @@ class base::yumtools::yum_puppet_lock ( $puppet_version = '3.7.2-1' ) { base::yumtools::versionlock { - "0:puppet-${puppet_version}.el${::lsbmajdistrelease}*": + "0:puppet-${puppet_version}.el${lsbmajdistrelease}*": ensure => present, } base::yumtools::versionlock { - "1:facter-${facter_version}.el${::lsbmajdistrelease}*": + "1:facter-${facter_version}.el${lsbmajdistrelease}*": ensure => present, } }