From 7dfac440c663e312116f8a7ab853569af15fe081 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 9 Feb 2023 17:46:19 +0000 Subject: [PATCH] (BUGFIX) Update to ensure correct facter comparisons Ensuring that the correct values are compared against facter, there seem to be many cases where lowercase has been used in place of uppercase. --- manifests/default_confd_files.pp | 2 +- manifests/default_mods.pp | 12 ++++++------ manifests/init.pp | 8 ++++---- manifests/mod.pp | 2 +- manifests/mod/cgid.pp | 4 ++-- manifests/mod/dav_fs.pp | 4 ++-- manifests/mod/disk_cache.pp | 6 +++--- manifests/mod/event.pp | 4 ++-- manifests/mod/itk.pp | 6 +++--- manifests/mod/peruser.pp | 4 ++-- manifests/mod/prefork.pp | 4 ++-- manifests/mod/ssl.pp | 8 ++++---- manifests/mod/worker.pp | 4 ++-- manifests/mpm.pp | 8 ++++---- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/manifests/default_confd_files.pp b/manifests/default_confd_files.pp index a92c53a26e..08808b35c4 100644 --- a/manifests/default_confd_files.pp +++ b/manifests/default_confd_files.pp @@ -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: { diff --git a/manifests/default_mods.pp b/manifests/default_mods.pp index efa1596ec6..42e2a44a5e 100644 --- a/manifests/default_mods.pp +++ b/manifests/default_mods.pp @@ -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': } @@ -21,7 +21,7 @@ } ::apache::mod { 'unixd': } } - 'freebsd': { + 'FreeBSD': { ::apache::mod { 'log_config': } ::apache::mod { 'unixd': } } @@ -31,7 +31,7 @@ default: {} } case $facts['os']['family'] { - 'gentoo': {} + 'Gentoo': {} default: { ::apache::mod { 'authz_host': } } @@ -39,11 +39,11 @@ # 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 @@ -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 diff --git a/manifests/init.pp b/manifests/init.pp index a7c6f10319..b230bdb789 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ -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') { @@ -755,7 +755,7 @@ } $apxs_workaround = $facts['os']['family'] ? { - 'freebsd' => true, + 'FreeBSD' => true, default => false } @@ -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': diff --git a/manifests/mod.pp b/manifests/mod.pp index 7d354f87e7..92fbc9528e 100644 --- a/manifests/mod.pp +++ b/manifests/mod.pp @@ -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}"] ], diff --git a/manifests/mod/cgid.pp b/manifests/mod/cgid.pp index 90ad2c56f3..de3469ba64 100644 --- a/manifests/mod/cgid.pp +++ b/manifests/mod/cgid.pp @@ -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, } diff --git a/manifests/mod/dav_fs.pp b/manifests/mod/dav_fs.pp index e944bcd0b9..387a47468e 100644 --- a/manifests/mod/dav_fs.pp +++ b/manifests/mod/dav_fs.pp @@ -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', } diff --git a/manifests/mod/disk_cache.pp b/manifests/mod/disk_cache.pp index 17ea3ebfa4..c0f4b787cf 100644 --- a/manifests/mod/disk_cache.pp +++ b/manifests/mod/disk_cache.pp @@ -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', } } diff --git a/manifests/mod/event.pp b/manifests/mod/event.pp index 4a27e479bd..3852e6e0c6 100644 --- a/manifests/mod/event.pp +++ b/manifests/mod/event.pp @@ -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', } diff --git a/manifests/mod/itk.pp b/manifests/mod/itk.pp index 5d67e52a79..e7143b489c 100644 --- a/manifests/mod/itk.pp +++ b/manifests/mod/itk.pp @@ -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', } diff --git a/manifests/mod/peruser.pp b/manifests/mod/peruser.pp index 85573e67a0..5f46bbe066 100644 --- a/manifests/mod/peruser.pp +++ b/manifests/mod/peruser.pp @@ -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', } diff --git a/manifests/mod/prefork.pp b/manifests/mod/prefork.pp index bca367bfb1..5319fce608 100644 --- a/manifests/mod/prefork.pp +++ b/manifests/mod/prefork.pp @@ -76,7 +76,7 @@ } case $facts['os']['family'] { - 'redhat', 'debian', 'freebsd': { + 'RedHat', 'Debian', 'FreeBSD': { ::apache::mpm { 'prefork': } } @@ -85,7 +85,7 @@ lib_path => '/usr/lib64/apache2-prefork', } } - 'gentoo': { + 'Gentoo': { ::portage::makeconf { 'apache2_mpms': content => 'prefork', } diff --git a/manifests/mod/ssl.pp b/manifests/mod/ssl.pp index f17a940188..4f14eb2495 100644 --- a/manifests/mod/ssl.pp +++ b/manifests/mod/ssl.pp @@ -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 { diff --git a/manifests/mod/worker.pp b/manifests/mod/worker.pp index ef6a97d7b2..995737f246 100644 --- a/manifests/mod/worker.pp +++ b/manifests/mod/worker.pp @@ -87,7 +87,7 @@ } case $facts['os']['family'] { - 'redhat', 'debian', 'freebsd': { + 'RedHat', 'Debian', 'FreeBSD': { ::apache::mpm { 'worker': } } @@ -97,7 +97,7 @@ } } - 'gentoo': { + 'Gentoo': { ::portage::makeconf { 'apache2_mpms': content => 'worker', } diff --git a/manifests/mpm.pp b/manifests/mpm.pp index 24cef5608c..d4b15853d2 100644 --- a/manifests/mpm.pp +++ b/manifests/mpm.pp @@ -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", @@ -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': {