Commit a58c00d2 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

some puppet-lint changes

parent 74b66822
......@@ -9,41 +9,41 @@ class su_apache (
include webauth
}
if ($osfamily == 'RedHat') {
if ($::osfamily == 'RedHat') {
package { 'apache':
name => 'httpd',
ensure => present,
name => 'httpd',
}
} elsif ($osfamily == 'Debian') {
} elsif ($::osfamily == 'Debian') {
if (($::lsbdistcodename == 'wheezy') or ($::lsbdistcodename == 'jessie')) {
package { 'apache':
name => 'apache2-mpm-prefork',
ensure => present,
name => 'apache2-mpm-prefork',
}
} else {
package { 'apache':
name => 'apache2',
ensure => present,
name => 'apache2',
}
}
} else {
crit("do not know what to do")
crit('do not know what to do')
}
# Name the service apache, which doesn't match the name from either OS but
# is easier to remember.
service { 'apache':
name => $osfamily ? {
ensure => running,
name => $::osfamily ? {
'Debian' => 'apache2',
'RedHat' => 'httpd',
},
ensure => running,
hasrestart => true,
hasstatus => $osfamily ? {
hasstatus => $::osfamily ? {
'RedHat' => false,
default => true,
},
status => $osfamily ? {
status => $::osfamily ? {
'RedHat' => 'pidof httpd',
default => undef,
},
......@@ -54,8 +54,8 @@ class su_apache (
# does a configtest by default, but the Red Hat one does not, so force Red
# Hat to do the right thing.
exec { 'su_apache_reload':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => $osfamily ? {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => $::osfamily ? {
'Debian' => 'service apache2 reload',
'RedHat' => 'sh -c "apachectl configtest && /etc/init.d/httpd reload"',
},
......@@ -64,9 +64,10 @@ class su_apache (
}
# Operating-system-specific Apache tweaks.
case $osfamily {
case $::osfamily {
'Debian': { include su_apache::debian }
'RedHat': { include su_apache::redhat }
default: { fail("no support for osfamily ${::osfamily}") }
}
include su_apache::filter_syslog
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment