Skip to content

Commit f505084

Browse files
fix(web)!: drop support for apache 2.2
1 parent 90ab907 commit f505084

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

manifests/web.pp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,13 @@
393393
$apache_listen_port = $apache_listenport
394394
}
395395

396-
# Apache >= 2.4
397-
$directory_allow = { 'require' => 'all granted', }
398-
$directory_deny = { 'require' => 'all denied', }
396+
if versioncmp($apache::apache_version, '2.4') < 0 {
397+
fail('Only apache >= 2.4 is supported')
398+
}
399399

400400
$location_api_access = $zabbix_api_access ? {
401-
undef => $directory_allow,
402-
default => if versioncmp($apache::apache_version, '2.4') >= 0 {
403-
{ 'require' => $zabbix_api_access.map |$host| { "host ${host}" }, }
404-
} else {
405-
{ 'allow' => $zabbix_api_access, 'order' => 'Allow,Deny' }
406-
}
401+
undef => 'all granted',
402+
default => $zabbix_api_access.map |$host| { "host ${host}" },
407403
}
408404

409405
apache::vhost { $zabbix_url:
@@ -413,33 +409,37 @@
413409
default_vhost => $default_vhost,
414410
add_listen => true,
415411
directories => [
416-
merge(
417-
merge({
418-
path => '/usr/share/zabbix',
419-
provider => 'directory',
420-
}, $directory_allow),
421-
$fcgi_filematch
422-
),
423412
merge({
424-
path => '/usr/share/zabbix/conf',
413+
path => '/usr/share/zabbix',
425414
provider => 'directory',
426-
}, $directory_deny),
427-
merge({
428-
path => '/usr/share/zabbix/api',
429-
provider => 'directory',
430-
}, $directory_deny),
431-
merge({
432-
path => '/usr/share/zabbix/include',
433-
provider => 'directory',
434-
}, $directory_deny),
435-
merge({
436-
path => '/usr/share/zabbix/include/classes',
437-
provider => 'directory',
438-
}, $directory_deny),
439-
merge({
440-
path => '/api_jsonrpc.php',
441-
provider => 'location',
442-
}, $location_api_access),
415+
require => 'all granted',
416+
}, $fcgi_filematch
417+
),
418+
{
419+
path => '/usr/share/zabbix/conf',
420+
provider => 'directory',
421+
require => 'all denied',
422+
},
423+
{
424+
path => '/usr/share/zabbix/api',
425+
provider => 'directory',
426+
require => 'all denied',
427+
},
428+
{
429+
path => '/usr/share/zabbix/include',
430+
provider => 'directory',
431+
require => 'all denied',
432+
},
433+
{
434+
path => '/usr/share/zabbix/include/classes',
435+
provider => 'directory',
436+
require => 'all denied',
437+
},
438+
{
439+
path => '/api_jsonrpc.php',
440+
provider => 'location',
441+
require => $location_api_access,
442+
},
443443
],
444444
custom_fragment => $apache_vhost_custom_fragment,
445445
rewrites => [

0 commit comments

Comments
 (0)