From 681463fe655d30ef49f4b16e528fcf58e38da0c6 Mon Sep 17 00:00:00 2001 From: Thomas Minor Date: Thu, 1 Feb 2024 12:16:01 +0100 Subject: [PATCH] fix: handle undefined value of $cache_ignore_headers in deprecated module and remove module from bsd defaults --- manifests/default_mods.pp | 2 -- manifests/mod/disk_cache.pp | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/manifests/default_mods.pp b/manifests/default_mods.pp index b03b2660b5..474b53748b 100644 --- a/manifests/default_mods.pp +++ b/manifests/default_mods.pp @@ -69,8 +69,6 @@ 'FreeBSD': { include apache::mod::actions include apache::mod::authn_core - include apache::mod::cache - include apache::mod::disk_cache include apache::mod::filter include apache::mod::headers include apache::mod::info diff --git a/manifests/mod/disk_cache.pp b/manifests/mod/disk_cache.pp index 57ee028e14..5e46107a7d 100644 --- a/manifests/mod/disk_cache.pp +++ b/manifests/mod/disk_cache.pp @@ -1,6 +1,6 @@ # @summary # Installs and configures `mod_disk_cache`. -# +# # @param cache_root # Defines the name of the directory on the disk to contain cache files. # Default depends on the Apache version and operating system: @@ -28,10 +28,15 @@ ) { deprecation('apache::mod::disk_cache', 'This class is deprecated; please use apache::mod::cache_disk') + $_cache_ignore_headers = $cache_ignore_headers ? { + undef => [], + default => $cache_ignore_headers.split(' ') + } + class { 'apache::mod::cache_disk': cache_root => $cache_root, cache_enable => ['/'], - cache_ignore_headers => $cache_ignore_headers.split(' '), + cache_ignore_headers => $_cache_ignore_headers, cache_dir_length => 1, cache_dir_levels => 2, configuration_file_name => 'cache_disk.conf'