Skip to content

Commit

Permalink
Merge pull request #2387 from david22swan/bugfix/facter_case_fix
Browse files Browse the repository at this point in the history
(BUGFIX) Update to ensure correct facter comparisons
  • Loading branch information
pmcmaw authored Feb 10, 2023
2 parents 04d7b51 + 290e096 commit f618243
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion manifests/default_confd_files.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The rest of the conf.d/* files only get loaded if we want them
if $all {
case $facts['os']['family'] {
'freebsd': {
'FreeBSD': {
include apache::confd::no_accf
}
default: {
Expand Down
12 changes: 6 additions & 6 deletions manifests/default_mods.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# They are not configurable at this time, so we just include
# them to make sure it works.
case $facts['os']['family'] {
'redhat': {
'RedHat': {
::apache::mod { 'log_config': }
if $facts['os']['name'] != 'Amazon' and $use_systemd {
::apache::mod { 'systemd': }
Expand All @@ -21,7 +21,7 @@
}
::apache::mod { 'unixd': }
}
'freebsd': {
'FreeBSD': {
::apache::mod { 'log_config': }
::apache::mod { 'unixd': }
}
Expand All @@ -31,19 +31,19 @@
default: {}
}
case $facts['os']['family'] {
'gentoo': {}
'Gentoo': {}
default: {
::apache::mod { 'authz_host': }
}
}
# The rest of the modules only get loaded if we want all modules enabled
if $all {
case $facts['os']['family'] {
'debian': {
'Debian': {
include apache::mod::authn_core
include apache::mod::reqtimeout
}
'redhat': {
'RedHat': {
include apache::mod::actions
include apache::mod::authn_core
include apache::mod::cache
Expand All @@ -66,7 +66,7 @@
::apache::mod { 'substitute': }
::apache::mod { 'usertrack': }
}
'freebsd': {
'FreeBSD': {
include apache::mod::actions
include apache::mod::authn_core
include apache::mod::cache
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
Optional[Boolean] $protocols_honor_order = undef,
) inherits apache::params {
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
# On redhat 7 the ssl.conf lives in /etc/httpd/conf.d (the confd_dir)
# On RedHat 7 the ssl.conf lives in /etc/httpd/conf.d (the confd_dir)
# when all other module configs live in /etc/httpd/conf.modules.d (the
# mod_dir). On all other platforms and versions, ssl.conf lives in the
# mod_dir. This should maintain the expected location of ssl.conf
Expand Down Expand Up @@ -731,7 +731,7 @@
}

if $apache::conf_dir and $apache::params::conf_file {
if $facts['os']['family'] == 'gentoo' {
if $facts['os']['family'] == 'Gentoo' {
$error_documents_path = '/usr/share/apache2/error'
if $default_mods =~ Array {
if defined('apache::mod::ssl') {
Expand All @@ -755,7 +755,7 @@
}

$apxs_workaround = $facts['os']['family'] ? {
'freebsd' => true,
'FreeBSD' => true,
default => false
}

Expand Down Expand Up @@ -837,7 +837,7 @@
use_port_for_filenames => true,
}
$ssl_access_log_file = $facts['os']['family'] ? {
'freebsd' => $access_log_file,
'FreeBSD' => $access_log_file,
default => "ssl_${access_log_file}",
}
::apache::vhost { 'default-ssl':
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
# ordering, we ensure that our version of httpd.conf is reverted after
# the module gets installed.
$package_before = $facts['os']['family'] ? {
'freebsd' => [
'FreeBSD' => [
File[$_loadfile_name],
File["${apache::conf_dir}/${apache::params::conf_file}"]
],
Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/cgid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# Debian specifies it's cgid sock path, but RedHat uses the default value
# with no config file
$cgisock_path = $facts['os']['family'] ? {
'debian' => "\${APACHE_RUN_DIR}/cgisock",
'freebsd' => 'cgisock',
'Debian' => "\${APACHE_RUN_DIR}/cgisock",
'FreeBSD' => 'cgisock',
default => undef,
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/dav_fs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class apache::mod::dav_fs {
include apache
$dav_lock = $facts['os']['family'] ? {
'debian' => "\${APACHE_LOCK_DIR}/DAVLock",
'freebsd' => '/usr/local/var/DavLock',
'Debian' => "\${APACHE_LOCK_DIR}/DAVLock",
'FreeBSD' => '/usr/local/var/DavLock',
default => '/var/lib/dav/lockdb',
}

Expand Down
6 changes: 3 additions & 3 deletions manifests/mod/disk_cache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
$_cache_root = $cache_root
} else {
$_cache_root = $facts['os']['family'] ? {
'debian' => '/var/cache/apache2/mod_cache_disk',
'redhat' => '/var/cache/httpd/proxy',
'freebsd' => '/var/cache/mod_cache_disk',
'Debian' => '/var/cache/apache2/mod_cache_disk',
'RedHat' => '/var/cache/httpd/proxy',
'FreeBSD' => '/var/cache/mod_cache_disk',
}
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/event.pp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
}

case $facts['os']['family'] {
'redhat', 'debian', 'freebsd' : {
'RedHat', 'Debian', 'FreeBSD' : {
apache::mpm { 'event':
}
}
'gentoo': {
'Gentoo': {
::portage::makeconf { 'apache2_mpms':
content => 'event',
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/mod/itk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@
}

case $facts['os']['family'] {
'redhat': {
'RedHat': {
package { 'httpd-itk':
ensure => present,
}
::apache::mpm { 'itk':
}
}
'debian', 'freebsd': {
'Debian', 'FreeBSD': {
apache::mpm { 'itk':
}
}
'gentoo': {
'Gentoo': {
::portage::makeconf { 'apache2_mpms':
content => 'itk',
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/peruser.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
) {
include apache
case $facts['os']['family'] {
'freebsd' : {
'FreeBSD' : {
fail("Unsupported osfamily ${$facts['os']['family']}")
}
default: {
if $facts['os']['family'] == 'gentoo' {
if $facts['os']['family'] == 'Gentoo' {
::portage::makeconf { 'apache2_mpms':
content => 'peruser',
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/prefork.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}

case $facts['os']['family'] {
'redhat', 'debian', 'freebsd': {
'RedHat', 'Debian', 'FreeBSD': {
::apache::mpm { 'prefork':
}
}
Expand All @@ -85,7 +85,7 @@
lib_path => '/usr/lib64/apache2-prefork',
}
}
'gentoo': {
'Gentoo': {
::portage::makeconf { 'apache2_mpms':
content => 'prefork',
}
Expand Down
8 changes: 4 additions & 4 deletions manifests/mod/ssl.pp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@

if $stapling_cache =~ Undef {
$_stapling_cache = $facts['os']['family'] ? {
'debian' => "\${APACHE_RUN_DIR}/ocsp(32768)",
'redhat' => '/run/httpd/ssl_stapling(32768)',
'freebsd' => '/var/run/ssl_stapling(32768)',
'gentoo' => '/var/run/ssl_stapling(32768)',
'Debian' => "\${APACHE_RUN_DIR}/ocsp(32768)",
'RedHat' => '/run/httpd/ssl_stapling(32768)',
'FreeBSD' => '/var/run/ssl_stapling(32768)',
'Gentoo' => '/var/run/ssl_stapling(32768)',
'Suse' => '/var/lib/apache2/ssl_stapling(32768)',
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/version.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @see https://httpd.apache.org/docs/current/mod/mod_version.html for additional documentation.
#
class apache::mod::version {
if $facts['os']['family'] == 'debian' {
if $facts['os']['family'] == 'Debian' {
warning("${module_name}: module version_module is built-in and can't be loaded")
} else {
::apache::mod { 'version': }
Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/worker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
}

case $facts['os']['family'] {
'redhat', 'debian', 'freebsd': {
'RedHat', 'Debian', 'FreeBSD': {
::apache::mpm { 'worker':
}
}
Expand All @@ -97,7 +97,7 @@
}
}

'gentoo': {
'Gentoo': {
::portage::makeconf { 'apache2_mpms':
content => 'worker',
}
Expand Down
8 changes: 4 additions & 4 deletions manifests/mpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

case $facts['os']['family'] {
'debian': {
'Debian': {
file { "${apache::mod_enable_dir}/${mpm}.conf":
ensure => link,
target => "${apache::mod_dir}/${mpm}.conf",
Expand Down Expand Up @@ -92,15 +92,15 @@
}
}

'freebsd': {
'FreeBSD': {
class { 'apache::package':
mpm_module => $mpm,
}
}
'gentoo': {
'Gentoo': {
# so we don't fail
}
'redhat': {
'RedHat': {
# so we don't fail
}
'Suse': {
Expand Down

0 comments on commit f618243

Please sign in to comment.