|
1 class apache::default_mods ( |
|
2 $all = true, |
|
3 $mods = undef, |
|
4 $apache_version = $::apache::apache_version, |
|
5 $use_systemd = $::apache::use_systemd, |
|
6 ) { |
|
7 # These are modules required to run the default configuration. |
|
8 # They are not configurable at this time, so we just include |
|
9 # them to make sure it works. |
|
10 case $::osfamily { |
|
11 'redhat': { |
|
12 ::apache::mod { 'log_config': } |
|
13 if versioncmp($apache_version, '2.4') >= 0 { |
|
14 # Lets fork it |
|
15 # Do not try to load mod_systemd on RHEL/CentOS 6 SCL. |
|
16 if ( !($::osfamily == 'redhat' and versioncmp($::operatingsystemrelease, '7.0') == -1) and !($::operatingsystem == 'Amazon') ) { |
|
17 if ($use_systemd) { |
|
18 ::apache::mod { 'systemd': } |
|
19 } |
|
20 } |
|
21 ::apache::mod { 'unixd': } |
|
22 } |
|
23 } |
|
24 'freebsd': { |
|
25 ::apache::mod { 'log_config': } |
|
26 ::apache::mod { 'unixd': } |
|
27 } |
|
28 'Suse': { |
|
29 ::apache::mod { 'log_config': } |
|
30 } |
|
31 default: {} |
|
32 } |
|
33 case $::osfamily { |
|
34 'gentoo': {} |
|
35 default: { |
|
36 ::apache::mod { 'authz_host': } |
|
37 } |
|
38 } |
|
39 # The rest of the modules only get loaded if we want all modules enabled |
|
40 if $all { |
|
41 case $::osfamily { |
|
42 'debian': { |
|
43 include ::apache::mod::authn_core |
|
44 include ::apache::mod::reqtimeout |
|
45 if versioncmp($apache_version, '2.4') < 0 { |
|
46 ::apache::mod { 'authn_alias': } |
|
47 } |
|
48 } |
|
49 'redhat': { |
|
50 include ::apache::mod::actions |
|
51 include ::apache::mod::authn_core |
|
52 include ::apache::mod::cache |
|
53 include ::apache::mod::ext_filter |
|
54 include ::apache::mod::mime |
|
55 include ::apache::mod::mime_magic |
|
56 include ::apache::mod::rewrite |
|
57 include ::apache::mod::speling |
|
58 include ::apache::mod::suexec |
|
59 include ::apache::mod::version |
|
60 include ::apache::mod::vhost_alias |
|
61 ::apache::mod { 'auth_digest': } |
|
62 ::apache::mod { 'authn_anon': } |
|
63 ::apache::mod { 'authn_dbm': } |
|
64 ::apache::mod { 'authz_dbm': } |
|
65 ::apache::mod { 'authz_owner': } |
|
66 ::apache::mod { 'expires': } |
|
67 ::apache::mod { 'include': } |
|
68 ::apache::mod { 'logio': } |
|
69 ::apache::mod { 'substitute': } |
|
70 ::apache::mod { 'usertrack': } |
|
71 |
|
72 if versioncmp($apache_version, '2.4') < 0 { |
|
73 ::apache::mod { 'authn_alias': } |
|
74 ::apache::mod { 'authn_default': } |
|
75 } |
|
76 } |
|
77 'freebsd': { |
|
78 include ::apache::mod::actions |
|
79 include ::apache::mod::authn_core |
|
80 include ::apache::mod::cache |
|
81 include ::apache::mod::disk_cache |
|
82 include ::apache::mod::headers |
|
83 include ::apache::mod::info |
|
84 include ::apache::mod::mime_magic |
|
85 include ::apache::mod::reqtimeout |
|
86 include ::apache::mod::rewrite |
|
87 include ::apache::mod::userdir |
|
88 include ::apache::mod::version |
|
89 include ::apache::mod::vhost_alias |
|
90 include ::apache::mod::speling |
|
91 include ::apache::mod::filter |
|
92 |
|
93 ::apache::mod { 'asis': } |
|
94 ::apache::mod { 'auth_digest': } |
|
95 ::apache::mod { 'auth_form': } |
|
96 ::apache::mod { 'authn_anon': } |
|
97 ::apache::mod { 'authn_dbm': } |
|
98 ::apache::mod { 'authn_socache': } |
|
99 ::apache::mod { 'authz_dbd': } |
|
100 ::apache::mod { 'authz_dbm': } |
|
101 ::apache::mod { 'authz_owner': } |
|
102 ::apache::mod { 'dumpio': } |
|
103 ::apache::mod { 'expires': } |
|
104 ::apache::mod { 'file_cache': } |
|
105 ::apache::mod { 'imagemap':} |
|
106 ::apache::mod { 'include': } |
|
107 ::apache::mod { 'logio': } |
|
108 ::apache::mod { 'request': } |
|
109 ::apache::mod { 'session': } |
|
110 ::apache::mod { 'unique_id': } |
|
111 } |
|
112 default: {} |
|
113 } |
|
114 case $::apache::mpm_module { |
|
115 'prefork': { |
|
116 include ::apache::mod::cgi |
|
117 } |
|
118 'worker': { |
|
119 include ::apache::mod::cgid |
|
120 } |
|
121 default: { |
|
122 # do nothing |
|
123 } |
|
124 } |
|
125 include ::apache::mod::alias |
|
126 include ::apache::mod::authn_file |
|
127 include ::apache::mod::autoindex |
|
128 include ::apache::mod::dav |
|
129 include ::apache::mod::dav_fs |
|
130 include ::apache::mod::deflate |
|
131 include ::apache::mod::dir |
|
132 include ::apache::mod::mime |
|
133 include ::apache::mod::negotiation |
|
134 include ::apache::mod::setenvif |
|
135 ::apache::mod { 'auth_basic': } |
|
136 |
|
137 if versioncmp($apache_version, '2.4') >= 0 { |
|
138 # filter is needed by mod_deflate |
|
139 include ::apache::mod::filter |
|
140 |
|
141 # authz_core is needed for 'Require' directive |
|
142 ::apache::mod { 'authz_core': |
|
143 id => 'authz_core_module', |
|
144 } |
|
145 |
|
146 # lots of stuff seems to break without access_compat |
|
147 ::apache::mod { 'access_compat': } |
|
148 } else { |
|
149 include ::apache::mod::authz_default |
|
150 } |
|
151 |
|
152 include ::apache::mod::authz_user |
|
153 |
|
154 ::apache::mod { 'authz_groupfile': } |
|
155 ::apache::mod { 'env': } |
|
156 } elsif $mods { |
|
157 ::apache::default_mods::load { $mods: } |
|
158 |
|
159 if versioncmp($apache_version, '2.4') >= 0 { |
|
160 # authz_core is needed for 'Require' directive |
|
161 ::apache::mod { 'authz_core': |
|
162 id => 'authz_core_module', |
|
163 } |
|
164 |
|
165 # filter is needed by mod_deflate |
|
166 include ::apache::mod::filter |
|
167 } |
|
168 } else { |
|
169 if versioncmp($apache_version, '2.4') >= 0 { |
|
170 # authz_core is needed for 'Require' directive |
|
171 ::apache::mod { 'authz_core': |
|
172 id => 'authz_core_module', |
|
173 } |
|
174 |
|
175 # filter is needed by mod_deflate |
|
176 include ::apache::mod::filter |
|
177 } |
|
178 } |
|
179 } |