Skip to content
Snippets Groups Projects
Verified Commit f0bf1edb authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

some work on Puppet 4 compatibility

parent dfbf0d52
No related branches found
No related tags found
No related merge requests found
release/005.009 (2017-07-07) unreleased (2017-??-??)
[ntp] Push "tinker-panic 0" to the top of the ntp.conf file to help Starting the work to make the code Puppet 4 compatible. [adamhl]
release/005.009 (2017-07-07)
[ntp] Push "tinker-panic 0" to the top of the ntp.conf file to help
address the timekeeping problem with vmware. This means always reset address the timekeeping problem with vmware. This means always reset
the clock, even if the new time is more than 1000s away from the the clock, even if the new time is more than 1000s away from the
current system time. [ljlgeek] current system time. [ljlgeek]
release/005.008 (2017-06-25) release/005.008 (2017-06-25)
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# ensure => absent, # ensure => absent,
# } # }
# #
# WARNING: On a running system, changing base::ipmi::ensure from present to # WARNING: On a running system, changing base::ipmi::ensure from present to
# absent may not work properly, depending on what user-space stuff is using # absent may not work properly, depending on what user-space stuff is using
# IPMI functionality. If you get errors, restart. # IPMI functionality. If you get errors, restart.
class base::ipmi ( class base::ipmi (
...@@ -50,7 +50,15 @@ class base::ipmi ( ...@@ -50,7 +50,15 @@ class base::ipmi (
# For Debian 8+, the package brings in everything it needs by # For Debian 8+, the package brings in everything it needs by
# default. But, if we are re-enabling we need to recover a file that # 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. # we deleted. We then have to trigger systemd to load modules.
if $::operatingsystem == 'Debian' and $::lsbmajdistrelease >= 8 { if ($::puppetversion =~ /^3/) {
$operatingsystem = $::operatingsystem
$lsdbmajdistrelease = $::lsdbmajdistrelease
} else {
$operatingsystem = $facts['os']['name']
$lsdbmajdistrelease = Integer($facts['os']['release']['major'])
}
if (($operatingsystem == 'Debian') and ($lsdbmajdistrelease >= 8)) {
exec { 'Re-create /usr/lib/modules-load.d/ipmievd.conf': exec { 'Re-create /usr/lib/modules-load.d/ipmievd.conf':
command => '/usr/bin/apt-get install --reinstall ipmitool', command => '/usr/bin/apt-get install --reinstall ipmitool',
creates => '/usr/lib/modules-load.d/ipmievd.conf', creates => '/usr/lib/modules-load.d/ipmievd.conf',
......
...@@ -55,7 +55,7 @@ define base::iptables::fragment($ensure, ...@@ -55,7 +55,7 @@ define base::iptables::fragment($ensure,
} }
default: { default: {
crit "Invalid ensure value: $ensure" fail "Invalid ensure value: $ensure"
} }
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# here is specific to the version of Linux we're running and is handled by # here is specific to the version of Linux we're running and is handled by
# the appropriate separate class. # the appropriate separate class.
class base::os { class base::os {
case $::operatingsystem { case $::operatingsystem {
'Debian': { include base::os::debian } 'Debian': { include base::os::debian }
'Ubuntu': { include base::os::ubuntu } 'Ubuntu': { include base::os::ubuntu }
...@@ -11,7 +11,7 @@ class base::os { ...@@ -11,7 +11,7 @@ class base::os {
'OracleLinux': { include base::os::oraclelinux } 'OracleLinux': { include base::os::oraclelinux }
default: { include base::os::debian } default: { include base::os::debian }
} }
base::os::motd { '/etc/motd': base::os::motd { '/etc/motd':
ensure => present, ensure => present,
template => 'base/os/motd.erb', template => 'base/os/motd.erb',
...@@ -33,8 +33,8 @@ class base::os { ...@@ -33,8 +33,8 @@ class base::os {
# Generate an iptables fact for the firewall team to query. # Generate an iptables fact for the firewall team to query.
file { '/var/lib/puppet/sufact/su_iptables': file { '/var/lib/puppet/sufact/su_iptables':
ensure => $::osfamily ? { ensure => $::osfamily ? {
RedHat => '/etc/sysconfig/iptables', 'RedHat' => '/etc/sysconfig/iptables',
default => '/etc/iptables/general', default => '/etc/iptables/general',
} }
} }
......
...@@ -32,7 +32,7 @@ class base::out_of_date::client::disabled inherits base::out_of_date::client { ...@@ -32,7 +32,7 @@ class base::out_of_date::client::disabled inherits base::out_of_date::client {
} }
class base::out_of_date::client::dev inherits base::out_of_date::client { class base::out_of_date::client::dev inherits base::out_of_date::client {
File ['/etc/out-of-date/client.conf'] { File['/etc/out-of-date/client.conf'] {
source => 'puppet:///modules/base/out-of-date/etc/out-of-date/client-dev.conf' source => 'puppet:///modules/base/out-of-date/etc/out-of-date/client-dev.conf'
} }
} }
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
# Basic class, for most systems. # Basic class, for most systems.
class base::pam { class base::pam {
case $osfamily { case $osfamily {
RedHat: { include base::pam::redhat } 'RedHat': { include base::pam::redhat }
Debian: { include base::pam::debian } 'Debian': { include base::pam::debian }
} }
} }
# Allows access to all users with a SUNet ID. Mostly for timeshares and such. # Allows access to all users with a SUNet ID. Mostly for timeshares and such.
class base::pam::ldap inherits base::pam { class base::pam::ldap inherits base::pam {
case $osfamily { case $osfamily {
RedHat: { include base::pam::redhat::ldap } 'RedHat': { include base::pam::redhat::ldap }
Debian: { include base::pam::debian::ldap } 'Debian': { include base::pam::debian::ldap }
} }
} }
...@@ -6,8 +6,14 @@ class base::pam::debian { ...@@ -6,8 +6,14 @@ class base::pam::debian {
package { 'libpam-krb5': ensure => present } package { 'libpam-krb5': ensure => present }
package { 'libpam-afs-session': ensure => present } package { 'libpam-afs-session': ensure => present }
if ($::puppetversion =~ /^3/) {
$lsdbmajdistrelease = $::lsdbmajdistrelease
} else {
$lsdbmajdistrelease = Integer($facts['os']['release']['major'])
}
# Starting with Debian jessie, pam-auth-update manages the common PAM files. # Starting with Debian jessie, pam-auth-update manages the common PAM files.
if ($::lsdbmajdistrelease < 8) { if ($lsdbmajdistrelease < 8) {
file { file {
'/etc/pam.d/common-auth': '/etc/pam.d/common-auth':
source => 'puppet:///modules/base/pam/etc/pam.d/common-auth', source => 'puppet:///modules/base/pam/etc/pam.d/common-auth',
......
...@@ -28,7 +28,7 @@ define base::postfix::map( ...@@ -28,7 +28,7 @@ define base::postfix::map(
$source = undef) $source = undef)
{ {
if ($type != 'hash') and ($type != 'btree') { if ($type != 'hash') and ($type != 'btree') {
crit "unknown Postfix map type $type" fail "unknown Postfix map type $type"
} }
file { $name: file { $name:
......
...@@ -54,7 +54,7 @@ define base::puppetclient::config( ...@@ -54,7 +54,7 @@ define base::puppetclient::config(
} }
} }
absent: { file { $name: ensure => absent } } absent: { file { $name: ensure => absent } }
default: { crit "Invalid ensure value: ${ensure}" } default: { fail "Invalid ensure value: ${ensure}" }
} }
file { $defaultfile: file { $defaultfile:
......
...@@ -115,8 +115,8 @@ class base::ssh( ...@@ -115,8 +115,8 @@ class base::ssh(
service { 'ssh': service { 'ssh':
ensure => running, ensure => running,
name => $::osfamily ? { name => $::osfamily ? {
Debian => 'ssh', 'Debian' => 'ssh',
RedHat => 'sshd', 'RedHat' => 'sshd',
}, },
require => Package['openssh-server'], require => Package['openssh-server'],
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment