From 764931beacfab3393482e1d2e470abc363ad0cdb Mon Sep 17 00:00:00 2001 From: David Swan Date: Thu, 22 Nov 2018 15:26:21 +0000 Subject: [PATCH] (MODULES-5990) Addition of 'IncludeOptional conf-enabled/*.conf' to 'apache2.conf' on Debian Family OS of 9/18.04 onwards --- manifests/params.pp | 8 ++++++++ templates/httpd.conf.erb | 3 +++ 2 files changed, 11 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index b80eb86fb3..eaa9b82a27 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -69,6 +69,7 @@ $server_root = '/etc/httpd' $conf_dir = "${httpd_dir}/conf" $confd_dir = "${httpd_dir}/conf.d" + $conf_enabled = undef $mod_dir = $::apache::version::distrelease ? { '7' => "${httpd_dir}/conf.modules.d", default => "${httpd_dir}/conf.d", @@ -217,6 +218,11 @@ $server_root = '/etc/apache2' $conf_dir = $httpd_dir $confd_dir = "${httpd_dir}/conf.d" + if ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9') >= 0) or ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '18.04') >= 0) { + $conf_enabled = "${httpd_dir}/conf-enabled" + } else { + $conf_enabled = undef + } $mod_dir = "${httpd_dir}/mods-available" $mod_enable_dir = "${httpd_dir}/mods-enabled" $vhost_dir = "${httpd_dir}/sites-available" @@ -462,6 +468,7 @@ $server_root = '/usr/local' $conf_dir = $httpd_dir $confd_dir = "${httpd_dir}/Includes" + $conf_enabled = undef $mod_dir = "${httpd_dir}/Modules" $mod_enable_dir = undef $vhost_dir = "${httpd_dir}/Vhosts" @@ -602,6 +609,7 @@ $server_root = '/etc/apache2' $conf_dir = $httpd_dir $confd_dir = "${httpd_dir}/conf.d" + $conf_enabled = undef $mod_dir = "${httpd_dir}/mods-available" $mod_enable_dir = "${httpd_dir}/mods-enabled" $vhost_dir = "${httpd_dir}/sites-available" diff --git a/templates/httpd.conf.erb b/templates/httpd.conf.erb index aedefd0862..b455579fea 100755 --- a/templates/httpd.conf.erb +++ b/templates/httpd.conf.erb @@ -114,6 +114,9 @@ IncludeOptional "<%= @confd_dir %>/*.conf" <%- else -%> Include "<%= @confd_dir %>/*.conf" <%- end -%> +<%- if @conf_enabled and scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%> +IncludeOptional "<%= @conf_dir %>/*.conf" +<%- end -%> <% if @vhost_load_dir != @confd_dir -%> <%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%> IncludeOptional "<%= @vhost_load_dir %>/<%= @vhost_include_pattern %>"