|
5 | 5 | class apache::default_mods ( |
6 | 6 | Boolean $all = true, |
7 | 7 | Optional[Variant[Array[String], String]] $mods = undef, |
8 | | - String $apache_version = $apache::apache_version, |
9 | 8 | Boolean $use_systemd = $apache::use_systemd, |
10 | 9 | ) { |
11 | 10 | # These are modules required to run the default configuration. |
|
14 | 13 | case $facts['os']['family'] { |
15 | 14 | 'redhat': { |
16 | 15 | ::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': } |
29 | 18 | } |
| 19 | + if ($facts['os']['name'] == 'Amazon' and $facts['os']['release']['full'] == '2') { |
| 20 | + ::apache::mod { 'systemd': } |
| 21 | + } |
| 22 | + ::apache::mod { 'unixd': } |
30 | 23 | } |
31 | 24 | 'freebsd': { |
32 | 25 | ::apache::mod { 'log_config': } |
|
49 | 42 | 'debian': { |
50 | 43 | include apache::mod::authn_core |
51 | 44 | include apache::mod::reqtimeout |
52 | | - if versioncmp($apache_version, '2.4') < 0 { |
53 | | - ::apache::mod { 'authn_alias': } |
54 | | - } |
55 | 45 | } |
56 | 46 | 'redhat': { |
57 | 47 | include apache::mod::actions |
|
63 | 53 | include apache::mod::rewrite |
64 | 54 | include apache::mod::speling |
65 | 55 | include apache::mod::suexec |
66 | | - include apache::mod::version |
67 | 56 | include apache::mod::vhost_alias |
68 | 57 | ::apache::mod { 'auth_digest': } |
69 | 58 | ::apache::mod { 'authn_anon': } |
|
75 | 64 | ::apache::mod { 'logio': } |
76 | 65 | ::apache::mod { 'substitute': } |
77 | 66 | ::apache::mod { 'usertrack': } |
78 | | - |
79 | | - if versioncmp($apache_version, '2.4') < 0 { |
80 | | - ::apache::mod { 'authn_alias': } |
81 | | - ::apache::mod { 'authn_default': } |
82 | | - } |
83 | 67 | } |
84 | 68 | 'freebsd': { |
85 | 69 | include apache::mod::actions |
|
92 | 76 | include apache::mod::reqtimeout |
93 | 77 | include apache::mod::rewrite |
94 | 78 | include apache::mod::userdir |
95 | | - include apache::mod::version |
96 | 79 | include apache::mod::vhost_alias |
97 | 80 | include apache::mod::speling |
98 | 81 | include apache::mod::filter |
|
141 | 124 | include apache::mod::setenvif |
142 | 125 | include apache::mod::auth_basic |
143 | 126 |
|
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 |
147 | 129 |
|
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', |
157 | 133 | } |
158 | 134 |
|
| 135 | + # lots of stuff seems to break without access_compat |
| 136 | + ::apache::mod { 'access_compat': } |
| 137 | + |
159 | 138 | include apache::mod::authz_user |
160 | 139 | include apache::mod::authz_groupfile |
161 | 140 | include apache::mod::env |
162 | 141 | } elsif $mods { |
163 | 142 | ::apache::default_mods::load { $mods: } |
164 | 143 |
|
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', |
173 | 147 | } |
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 | | - } |
180 | 148 |
|
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', |
183 | 155 | } |
| 156 | + |
| 157 | + # filter is needed by mod_deflate |
| 158 | + include apache::mod::filter |
184 | 159 | } |
185 | 160 | } |
0 commit comments