Skip to content

Commit cedd45b

Browse files
committed
Drop Apache 2.2 support
1 parent 08ed7f8 commit cedd45b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+277
-1689
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
[aliased servers]: https://httpd.apache.org/docs/current/urlmapping.html
3131
[`AllowEncodedSlashes`]: https://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes
3232
[`apache`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apache
33-
[`apache_version`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apache_version
3433
[`apache::balancer`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachebalancer
3534
[`apache::balancermember`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachebalancermember
3635
[`apache::mod`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachemod

lib/facter/apache_version.rb

Lines changed: 0 additions & 29 deletions
This file was deleted.

manifests/balancer.pp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@
5050
) {
5151
include apache::mod::proxy_balancer
5252

53-
if versioncmp($apache::mod::proxy_balancer::apache_version, '2.4') >= 0 {
54-
$lbmethod = $proxy_set['lbmethod'] ? {
55-
undef => 'byrequests',
56-
default => $proxy_set['lbmethod'],
57-
}
58-
ensure_resource('apache::mod', "lbmethod_${lbmethod}", {
59-
'loadfile_name' => "proxy_balancer_lbmethod_${lbmethod}.load"
60-
})
53+
$lbmethod = $proxy_set['lbmethod'] ? {
54+
undef => 'byrequests',
55+
default => $proxy_set['lbmethod'],
6156
}
57+
ensure_resource('apache::mod', "lbmethod_${lbmethod}", {
58+
'loadfile_name' => "proxy_balancer_lbmethod_${lbmethod}.load"
59+
})
6260

6361
if $target {
6462
$_target = $target

manifests/default_mods.pp

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
class apache::default_mods (
66
Boolean $all = true,
77
Optional[Variant[Array[String], String]] $mods = undef,
8-
String $apache_version = $apache::apache_version,
98
Boolean $use_systemd = $apache::use_systemd,
109
) {
1110
# These are modules required to run the default configuration.
@@ -14,19 +13,13 @@
1413
case $facts['os']['family'] {
1514
'redhat': {
1615
::apache::mod { 'log_config': }
17-
if versioncmp($apache_version, '2.4') >= 0 {
18-
# Lets fork it
19-
# Do not try to load mod_systemd on RHEL/CentOS 6 SCL.
20-
if ( !($facts['os']['family'] == 'redhat' and versioncmp($facts['os']['release']['major'], '7') == -1) and !($facts['os']['name'] == 'Amazon') ) {
21-
if ($use_systemd) {
22-
::apache::mod { 'systemd': }
23-
}
24-
}
25-
if ($facts['os']['name'] == 'Amazon' and $facts['os']['release']['full'] == '2') {
26-
::apache::mod { 'systemd': }
27-
}
28-
::apache::mod { 'unixd': }
16+
if $facts['os']['name'] != 'Amazon' and $use_systemd {
17+
::apache::mod { 'systemd': }
2918
}
19+
if ($facts['os']['name'] == 'Amazon' and $facts['os']['release']['full'] == '2') {
20+
::apache::mod { 'systemd': }
21+
}
22+
::apache::mod { 'unixd': }
3023
}
3124
'freebsd': {
3225
::apache::mod { 'log_config': }
@@ -49,9 +42,6 @@
4942
'debian': {
5043
include apache::mod::authn_core
5144
include apache::mod::reqtimeout
52-
if versioncmp($apache_version, '2.4') < 0 {
53-
::apache::mod { 'authn_alias': }
54-
}
5545
}
5646
'redhat': {
5747
include apache::mod::actions
@@ -63,7 +53,6 @@
6353
include apache::mod::rewrite
6454
include apache::mod::speling
6555
include apache::mod::suexec
66-
include apache::mod::version
6756
include apache::mod::vhost_alias
6857
::apache::mod { 'auth_digest': }
6958
::apache::mod { 'authn_anon': }
@@ -75,11 +64,6 @@
7564
::apache::mod { 'logio': }
7665
::apache::mod { 'substitute': }
7766
::apache::mod { 'usertrack': }
78-
79-
if versioncmp($apache_version, '2.4') < 0 {
80-
::apache::mod { 'authn_alias': }
81-
::apache::mod { 'authn_default': }
82-
}
8367
}
8468
'freebsd': {
8569
include apache::mod::actions
@@ -92,7 +76,6 @@
9276
include apache::mod::reqtimeout
9377
include apache::mod::rewrite
9478
include apache::mod::userdir
95-
include apache::mod::version
9679
include apache::mod::vhost_alias
9780
include apache::mod::speling
9881
include apache::mod::filter
@@ -141,45 +124,37 @@
141124
include apache::mod::setenvif
142125
include apache::mod::auth_basic
143126

144-
if versioncmp($apache_version, '2.4') >= 0 {
145-
# filter is needed by mod_deflate
146-
include apache::mod::filter
127+
# filter is needed by mod_deflate
128+
include apache::mod::filter
147129

148-
# authz_core is needed for 'Require' directive
149-
::apache::mod { 'authz_core':
150-
id => 'authz_core_module',
151-
}
152-
153-
# lots of stuff seems to break without access_compat
154-
::apache::mod { 'access_compat': }
155-
} else {
156-
include apache::mod::authz_default
130+
# authz_core is needed for 'Require' directive
131+
::apache::mod { 'authz_core':
132+
id => 'authz_core_module',
157133
}
158134

135+
# lots of stuff seems to break without access_compat
136+
::apache::mod { 'access_compat': }
137+
159138
include apache::mod::authz_user
160139
include apache::mod::authz_groupfile
161140
include apache::mod::env
162141
} elsif $mods {
163142
::apache::default_mods::load { $mods: }
164143

165-
if versioncmp($apache_version, '2.4') >= 0 {
166-
# authz_core is needed for 'Require' directive
167-
::apache::mod { 'authz_core':
168-
id => 'authz_core_module',
169-
}
170-
171-
# filter is needed by mod_deflate
172-
include apache::mod::filter
144+
# authz_core is needed for 'Require' directive
145+
::apache::mod { 'authz_core':
146+
id => 'authz_core_module',
173147
}
174-
} else {
175-
if versioncmp($apache_version, '2.4') >= 0 {
176-
# authz_core is needed for 'Require' directive
177-
::apache::mod { 'authz_core':
178-
id => 'authz_core_module',
179-
}
180148

181-
# filter is needed by mod_deflate
182-
include apache::mod::filter
149+
# filter is needed by mod_deflate
150+
include apache::mod::filter
151+
} else {
152+
# authz_core is needed for 'Require' directive
153+
::apache::mod { 'authz_core':
154+
id => 'authz_core_module',
183155
}
156+
157+
# filter is needed by mod_deflate
158+
include apache::mod::filter
184159
}
185160
}

manifests/init.pp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
# responses to URLs containing '\' and '/' characters. If not specified, this parameter omits
1717
# the declaration from the server's configuration and uses Apache's default setting of 'off'.
1818
#
19-
# @param apache_version
20-
# Configures module template behavior, package names, and default Apache modules by defining
21-
# the version of Apache to use. We do not recommend manually configuring this parameter
22-
# without reason.
23-
#
2419
# @param conf_dir
2520
# Sets the directory where the Apache server's main configuration file is located.
2621
#
@@ -48,7 +43,7 @@
4843
# on your operating system, and you can declare any other modules separately using the
4944
# `apache::mod::<MODULE NAME>` class or `apache::mod` defined type.<br />
5045
# If `true`, Puppet installs additional modules, depending on the operating system and
51-
# the values of `apache_version` and `mpm_module` parameters. Because these lists of
46+
# the value of the `mpm_module` parameter. Because these lists of
5247
# modules can change frequently, consult the Puppet module's code for up-to-date lists.<br />
5348
# If this parameter contains an array, Puppet instead enables all passed Apache modules.
5449
#
@@ -307,11 +302,6 @@
307302
# Setting `purge_vhost_dir` to `false` is a stopgap measure to allow the apache module to
308303
# coexist with existing or otherwise unmanaged configurations within `vhost_dir`.
309304
#
310-
# @param rewrite_lock
311-
# Allows setting a custom location for a rewrite lock - considered best practice if using
312-
# a RewriteMap of type prg in the `rewrites` parameter of your virtual host. This parameter
313-
# only applies to Apache version 2.2 or lower and is ignored on newer versions.
314-
#
315305
# @param sendfile
316306
# Forces Apache to use the Linux kernel's `sendfile` support to serve static files, via the
317307
# `EnableSendfile` directive.
@@ -512,12 +502,11 @@
512502
String $vhost_include_pattern = $apache::params::vhost_include_pattern,
513503
Stdlib::Absolutepath $mod_dir = $apache::params::mod_dir,
514504
Optional[Stdlib::Absolutepath] $mod_enable_dir = $apache::params::mod_enable_dir,
515-
Variant[Boolean, String] $mpm_module = $apache::params::mpm_module,
505+
Variant[Boolean, Enum['event', 'itk', 'peruser', 'prefork', 'worker']] $mpm_module = $apache::params::mpm_module,
516506
String $lib_path = $apache::params::lib_path,
517507
String $conf_template = $apache::params::conf_template,
518508
Optional[String] $servername = $apache::params::servername,
519509
String $pidfile = $apache::params::pidfile,
520-
Optional[Stdlib::Absolutepath] $rewrite_lock = undef,
521510
Boolean $manage_user = true,
522511
Boolean $manage_group = true,
523512
String $user = $apache::params::user,
@@ -537,7 +526,6 @@
537526
Optional[String] $ssl_file = undef,
538527
Stdlib::Absolutepath $ports_file = $apache::params::ports_file,
539528
Stdlib::Absolutepath $docroot = $apache::params::docroot,
540-
String $apache_version = $apache::version::default,
541529
Apache::ServerTokens $server_tokens = 'Prod',
542530
Variant[Enum['On', 'Off'], String] $server_signature = 'On',
543531
Enum['On', 'Off', 'extended'] $trace_enable = 'On',
@@ -557,11 +545,6 @@
557545
Array[Enum['h2', 'h2c', 'http/1.1']] $protocols = [],
558546
Optional[Boolean] $protocols_honor_order = undef,
559547
) inherits apache::params {
560-
$valid_mpms_re = $apache_version ? {
561-
'2.4' => '(event|itk|peruser|prefork|worker)',
562-
default => '(event|itk|prefork|worker)'
563-
}
564-
565548
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
566549
# On redhat 7 the ssl.conf lives in /etc/httpd/conf.d (the confd_dir)
567550
# when all other module configs live in /etc/httpd/conf.modules.d (the
@@ -578,10 +561,6 @@
578561
}
579562
}
580563

581-
if $mpm_module and $mpm_module != 'false' { # lint:ignore:quoted_booleans
582-
assert_type(Pattern[$valid_mpms_re], $mpm_module)
583-
}
584-
585564
# NOTE: on FreeBSD it's mpm module's responsibility to install httpd package.
586565
# NOTE: the same strategy may be introduced for other OSes. For this, you
587566
# should delete the 'if' block below and modify all MPM modules' manifests
@@ -802,7 +781,6 @@
802781
# - $server_tokens
803782
# - $server_signature
804783
# - $trace_enable
805-
# - $rewrite_lock
806784
# - $root_directory_secured
807785
file { "${apache::conf_dir}/${apache::params::conf_file}":
808786
ensure => file,

manifests/mod.pp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@
8484
if $package {
8585
$_package = $package
8686
} elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack
87-
if ($apache::apache_version == '2.4' and $facts['os']['name'] =~ /^[Aa]mazon$/ and $facts['os']['release']['major'] != '2') {
88-
# On amazon linux we need to prefix our package name with mod24 instead of mod to support apache 2.4
89-
$_package = regsubst($mod_packages[$mod],'^(mod_)?(.*)','mod24_\2')
90-
} else {
91-
$_package = $mod_packages[$mod]
92-
}
87+
$_package = $mod_packages[$mod]
9388
} else {
9489
$_package = undef
9590
}

manifests/mod/alias.pp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# @summary
22
# Installs and configures `mod_alias`.
33
#
4-
# @param apache_version
5-
# The version of Apache, if not set will be retrieved from the init class.
6-
#
74
# @param icons_options
85
# Disables directory listings for the icons directory, via Apache [Options](https://httpd.apache.org/docs/current/mod/core.html#options)
96
# directive.
@@ -22,17 +19,15 @@
2219
# @see https://httpd.apache.org/docs/current/mod/mod_alias.html for additional documentation.
2320
#
2421
class apache::mod::alias (
25-
Optional[String] $apache_version = undef,
2622
String $icons_options = 'Indexes MultiViews',
2723
# set icons_path to false to disable the alias
2824
Variant[Boolean, Stdlib::Absolutepath] $icons_path = $apache::params::alias_icons_path,
2925
String $icons_prefix = $apache::params::icons_prefix
3026
) inherits apache::params {
3127
include apache
32-
$_apache_version = pick($apache_version, $apache::apache_version)
3328
apache::mod { 'alias': }
3429

35-
# Template uses $icons_path, $_apache_version
30+
# Template uses $icons_path
3631
if $icons_path {
3732
file { 'alias.conf':
3833
ensure => file,

manifests/mod/authn_core.pp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# @summary
22
# Installs `mod_authn_core`.
33
#
4-
# @param apache_version
5-
# The version of apache being run.
6-
#
74
# @see https://httpd.apache.org/docs/current/mod/mod_authn_core.html for additional documentation.
85
#
9-
class apache::mod::authn_core (
10-
Optional[String] $apache_version = $apache::apache_version
11-
) {
12-
if versioncmp($apache_version, '2.4') >= 0 {
13-
::apache::mod { 'authn_core': }
14-
}
6+
class apache::mod::authn_core {
7+
::apache::mod { 'authn_core': }
158
}

manifests/mod/authz_default.pp

Lines changed: 0 additions & 17 deletions
This file was deleted.

manifests/mod/data.pp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
# @summary
22
# Installs and configures `mod_data`.
33
#
4-
# @param apache_version
5-
# Version of Apache to install module on.
6-
#
74
# @see https://httpd.apache.org/docs/current/mod/mod_data.html for additional documentation.
85
#
9-
class apache::mod::data (
10-
Optional[String] $apache_version = undef,
11-
) {
6+
class apache::mod::data {
127
include apache
13-
$_apache_version = pick($apache_version, $apache::apache_version)
14-
if versioncmp($_apache_version, '2.3') < 0 {
15-
fail('mod_data is only available in Apache 2.3 and later')
16-
}
178
::apache::mod { 'data': }
189
}

0 commit comments

Comments
 (0)