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