Skip to content

Commit a31a2dc

Browse files
committed
(MODULES-5990) Addition of 'IncludeOptional conf-enabled/*.conf' to 'apache2.conf' on Debian Family OS of 9/18.04 onwards
1 parent dda155c commit a31a2dc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: manifests/params.pp

+8
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
$server_root = '/etc/httpd'
7070
$conf_dir = "${httpd_dir}/conf"
7171
$confd_dir = "${httpd_dir}/conf.d"
72+
$conf_enabled = undef
7273
$mod_dir = $::apache::version::distrelease ? {
7374
'7' => "${httpd_dir}/conf.modules.d",
7475
default => "${httpd_dir}/conf.d",
@@ -217,6 +218,11 @@
217218
$server_root = '/etc/apache2'
218219
$conf_dir = $httpd_dir
219220
$confd_dir = "${httpd_dir}/conf.d"
221+
if ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9') >= 0) or ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '18.04') >= 0) {
222+
$conf_enabled = "${httpd_dir}/conf-enabled"
223+
} else {
224+
$conf_enabled = undef
225+
}
220226
$mod_dir = "${httpd_dir}/mods-available"
221227
$mod_enable_dir = "${httpd_dir}/mods-enabled"
222228
$vhost_dir = "${httpd_dir}/sites-available"
@@ -462,6 +468,7 @@
462468
$server_root = '/usr/local'
463469
$conf_dir = $httpd_dir
464470
$confd_dir = "${httpd_dir}/Includes"
471+
$conf_enabled = undef
465472
$mod_dir = "${httpd_dir}/Modules"
466473
$mod_enable_dir = undef
467474
$vhost_dir = "${httpd_dir}/Vhosts"
@@ -602,6 +609,7 @@
602609
$server_root = '/etc/apache2'
603610
$conf_dir = $httpd_dir
604611
$confd_dir = "${httpd_dir}/conf.d"
612+
$conf_enabled = undef
605613
$mod_dir = "${httpd_dir}/mods-available"
606614
$mod_enable_dir = "${httpd_dir}/mods-enabled"
607615
$vhost_dir = "${httpd_dir}/sites-available"

Diff for: templates/httpd.conf.erb

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ IncludeOptional "<%= @confd_dir %>/*.conf"
114114
<%- else -%>
115115
Include "<%= @confd_dir %>/*.conf"
116116
<%- end -%>
117+
<%- if @conf_enabled and scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
118+
IncludeOptional "<%= @conf_enabled %>/*.conf"
119+
<%- end -%>
117120
<% if @vhost_load_dir != @confd_dir -%>
118121
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
119122
IncludeOptional "<%= @vhost_load_dir %>/<%= @vhost_include_pattern %>"

0 commit comments

Comments
 (0)