/[adm]/puppet/modules/apache/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/apache/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2488 - (hide annotations) (download)
Thu Mar 15 13:52:26 2012 UTC (12 years ago) by misc
File size: 6796 byte(s)
reorder variable, and correct 'before', since this break on friteuse
1 misc 80 class apache {
2     class base {
3 boklm 1500
4 misc 2225 # number of time the log file are rotated before being removed
5     $httpdlogs_rotate = "24"
6 boklm 1636
7 misc 2225 $apache_user = 'apache'
8     $apache_group = 'apache'
9 boklm 2104
10 misc 80 package { "apache-mpm-prefork":
11 misc 117 alias => apache,
12 misc 80 }
13    
14 misc 2225 package { "apache-conf": }
15 misc 1065
16 misc 96 service { httpd:
17     alias => apache,
18 misc 80 subscribe => [ Package['apache-mpm-prefork'] ],
19     }
20 misc 117
21 misc 2243 exec { "service httpd configtest":
22     refreshonly => true,
23     notify => Service["apache"],
24     }
25    
26 misc 2225 apache::config {
27     "/etc/httpd/conf.d/customization.conf":
28     content => template("apache/customization.conf");
29     "/etc/httpd/conf/vhosts.d/00_default_vhosts.conf":
30     content => template("apache/00_default_vhosts.conf");
31 misc 117 }
32 boklm 207
33 misc 2225 file { "/etc/logrotate.d/httpd":
34     content => template("apache/logrotate")
35 boklm 207 }
36 misc 80 }
37    
38     class mod_php inherits base {
39 misc 2124 $php_date_timezone = "UTC"
40 misc 1185
41 misc 2225 package { "apache-mod_php": }
42    
43     apache::config { "/etc/httpd/conf.d/mod_php.conf":
44 misc 1188 content => template('apache/mod_php.conf'),
45 misc 1185 }
46 misc 80 }
47    
48     class mod_perl inherits base {
49 misc 2225 package { "apache-mod_perl": }
50 misc 80 }
51    
52 misc 84 class mod_fcgid inherits base {
53 misc 2225 package { "apache-mod_fcgid": }
54 misc 84 }
55    
56 misc 124 class mod_fastcgi inherits base {
57 misc 2225 package { "apache-mod_fastcgi": }
58 misc 124 }
59 misc 84
60 misc 192 class mod_ssl inherits base {
61 misc 487 file { "/etc/ssl/apache/":
62     ensure => directory
63     }
64    
65 misc 2225 package { "apache-mod_ssl": }
66 boklm 1245
67 misc 2225 apache::config {
68     '/etc/httpd/conf/vhosts.d/01_default_ssl_vhost.conf':
69     content => template("apache/01_default_ssl_vhost.conf");
70     "/etc/httpd/conf.d/ssl.conf":
71     content => template("apache/ssl.conf");
72 boklm 2085 }
73 misc 192 }
74    
75 misc 80 class mod_wsgi inherits base {
76 misc 2225 package { "apache-mod_wsgi": }
77 misc 182
78 misc 201 file { "/usr/local/lib/wsgi":
79 misc 182 ensure => directory,
80     }
81 misc 908
82 misc 2225 apache::config { "/etc/httpd/conf.d/mod_wsgi.conf":
83 misc 1188 content => template('apache/mod_wsgi.conf'),
84 misc 908 }
85 misc 2225 }
86 misc 908
87 misc 778 class mod_proxy inherits base {
88 misc 2225 package { "apache-mod_proxy": }
89 misc 778 }
90 misc 167
91 misc 929 class mod_public_html inherits base {
92 misc 2225 package { "apache-mod_public_html": }
93 misc 929 }
94    
95 dams 1021 class mod_deflate inherits base {
96 misc 2225 package { "apache-mod_deflate": }
97 dams 1021 }
98    
99 boklm 2099 class mod_geoip inherits base {
100 misc 2225 package { "apache-mod_geoip": }
101 boklm 2099 }
102    
103 misc 928 define vhost_base($content = '',
104     $location = '/dev/null',
105     $use_ssl = false,
106 misc 930 $vhost = false,
107 misc 932 $aliases = {},
108 misc 935 $server_aliases = [],
109 misc 2225 $access_logfile = false,
110     $error_logfile = false,
111 pterjan 1599 $options = [],
112 misc 930 $enable_public_html = false) {
113 misc 2225 include apache::base
114     $httpd_logdir = "/var/log/httpd"
115 misc 2488 $filename = "$name.conf"
116 misc 2225
117 misc 928 if ! $vhost {
118     $real_vhost = $name
119     } else {
120     $real_vhost = $vhost
121 misc 176 }
122 misc 167
123 misc 2225 if ! $access_logfile {
124     $real_access_logfile = "$httpd_logdir/${real_vhost}-access_log"
125     } else {
126     $real_access_logfile = $access_logfile
127     }
128     if ! $error_logfile {
129     $real_error_logfile = "$httpd_logdir/${real_vhost}-error_log"
130     } else {
131     $real_error_logfile = $error_logfile
132     }
133 boklm 1630
134 misc 489 if $use_ssl {
135     include apache::mod_ssl
136 misc 2225 if $wildcard_sslcert != 'true' {
137     openssl::self_signed_cert{ "$real_vhost":
138     directory => "/etc/ssl/apache/",
139 misc 2488 before => Apache::Config["/etc/httpd/conf/vhosts.d/$filename"],
140 misc 2225 }
141     }
142 misc 489 }
143    
144 misc 930 if $enable_public_html {
145     include apache::mod_public_html
146     }
147    
148 misc 2225 apache::config { "/etc/httpd/conf/vhosts.d/$filename":
149 misc 928 content => template("apache/vhost_base.conf")
150     }
151     }
152    
153     define vhost_redirect_ssl() {
154     vhost_base { "redirect_ssl_$name":
155     vhost => $name,
156     content => template("apache/vhost_ssl_redirect.conf")
157     }
158     }
159    
160 boklm 1617 define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false, $vhost = false) {
161 misc 928
162     include apache::mod_fastcgi
163     vhost_base { $name:
164 misc 2225 vhost => $vhost,
165 misc 928 use_ssl => $use_ssl,
166 misc 2225 content => template("apache/vhost_catalyst_app.conf"),
167 misc 167 }
168     }
169 misc 182
170 misc 1193 define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) {
171 misc 182 include apache::mod_wsgi
172 misc 928 vhost_base { $name:
173 misc 934 use_ssl => $use_ssl,
174 misc 1193 content => template("apache/vhost_django_app.conf"),
175     aliases => $aliases,
176 misc 621 }
177 misc 928
178 misc 612 # module is a ruby reserved keyword, cannot be used in templates
179     $django_module = $module
180 misc 182 file { "$name.wsgi":
181 misc 201 path => "/usr/local/lib/wsgi/$name.wsgi",
182 misc 182 mode => 755,
183     notify => Service['apache'],
184 misc 2225 content => template("apache/django.wsgi"),
185 misc 182 }
186     }
187 boklm 280
188 misc 935 define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) {
189 misc 812 include apache::mod_wsgi
190 misc 933 vhost_base { $name:
191     aliases => $aliases,
192 misc 935 server_aliases => $server_aliases,
193 misc 2225 content => template("apache/vhost_wsgi.conf"),
194 misc 812 }
195     }
196    
197 boklm 280 define vhost_other_app($vhost_file) {
198 misc 412 include apache::base
199 misc 2225 apache::config { "/etc/httpd/conf/vhosts.d/$name.conf":
200     content => template($vhost_file),
201 boklm 280 }
202     }
203    
204 misc 742 define vhost_simple($location) {
205     include apache::base
206 misc 928 vhost_base { $name:
207     location => $location,
208     }
209 misc 742 }
210    
211 boklm 1319 define vhost_redirect($url,
212 misc 2225 $vhost = false,
213     $use_ssl = false) {
214 misc 931 include apache::base
215     vhost_base { $name:
216 boklm 1319 use_ssl => $use_ssl,
217     vhost => $vhost,
218 misc 931 content => template("apache/vhost_redirect.conf"),
219     }
220     }
221    
222 misc 1103 define vhost_reverse_proxy($url,
223     $vhost = false,
224     $use_ssl = false) {
225 misc 778 include apache::mod_proxy
226 misc 928 vhost_base { $name:
227 misc 1102 use_ssl => $use_ssl,
228 misc 1103 vhost => $vhost,
229 misc 778 content => template("apache/vhost_reverse_proxy.conf")
230 misc 928 }
231 misc 778 }
232    
233 misc 2225 define webapp_other($webapp_file) {
234 misc 422 include apache::base
235 boklm 280 $webappname = $name
236 misc 2225 apache::config { "/etc/httpd/conf/webapps.d/$webappname.conf":
237     content => template($webapp_file),
238 boklm 280 }
239 misc 2225 }
240 misc 80 }

  ViewVC Help
Powered by ViewVC 1.1.30