/[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 1319 - (hide annotations) (download)
Tue Mar 15 15:26:21 2011 UTC (13 years, 1 month ago) by boklm
File size: 7756 byte(s)
allow using ssl in vhost_redirect
1 misc 80 class apache {
2    
3     class base {
4     package { "apache-mpm-prefork":
5 misc 117 alias => apache,
6 misc 80 ensure => installed
7     }
8    
9 misc 1065 package { "apache-conf":
10     ensure => installed,
11     }
12    
13 misc 96 service { httpd:
14     alias => apache,
15 misc 80 ensure => running,
16     subscribe => [ Package['apache-mpm-prefork'] ],
17     }
18 misc 117
19     file { "customization.conf":
20     ensure => present,
21 misc 126 path => "/etc/httpd/conf.d/customization.conf",
22 misc 117 content => template("apache/customization.conf"),
23 misc 1065 require => Package["apache-conf"],
24 misc 117 notify => Service["apache"],
25     owner => root,
26     group => root,
27     mode => 644,
28     }
29 boklm 207
30     file { "00_default_vhosts.conf":
31     path => "/etc/httpd/conf/vhosts.d/00_default_vhosts.conf",
32     ensure => "present",
33     owner => root,
34     group => root,
35     mode => 644,
36     notify => Service['apache'],
37 misc 1065 require => Package["apache-conf"],
38 boklm 207 content => template("apache/00_default_vhosts.conf")
39     }
40 boklm 1241
41 misc 80 }
42    
43     class mod_php inherits base {
44     package { "apache-mod_php":
45     ensure => installed
46     }
47 misc 1185
48     file { "/etc/httpd/conf.d/mod_php.conf":
49     ensure => present,
50     owner => root,
51     group => root,
52     mode => 644,
53     require => Package['apache-conf'],
54 misc 1188 content => template('apache/mod_php.conf'),
55 misc 1186 notify => Service['apache'],
56 misc 1185 }
57 misc 80 }
58    
59     class mod_perl inherits base {
60     package { "apache-mod_perl":
61     ensure => installed
62     }
63     }
64    
65 misc 84 class mod_fcgid inherits base {
66     package { "apache-mod_fcgid":
67     ensure => installed
68     }
69     }
70    
71 misc 124 class mod_fastcgi inherits base {
72     package { "apache-mod_fastcgi":
73     ensure => installed
74     }
75     }
76 misc 84
77 misc 192 class mod_ssl inherits base {
78 misc 487 file { "/etc/ssl/apache/":
79     ensure => directory
80     }
81    
82 misc 192 package { "apache-mod_ssl":
83     ensure => installed
84     }
85 boklm 1245
86     file { "01_default_ssl_vhost.conf":
87     path => '/etc/httpd/conf/vhosts.d/01_default_ssl_vhost.conf',
88     ensure => "present",
89     owner => root,
90     group => root,
91     mode => 644,
92     notify => Service['apache'],
93     require => Package["apache-conf"],
94     content => template("apache/01_default_ssl_vhost.conf")
95     }
96 misc 192 }
97    
98 misc 80 class mod_wsgi inherits base {
99     package { "apache-mod_wsgi":
100     ensure => installed
101     }
102 misc 182
103 misc 201 file { "/usr/local/lib/wsgi":
104 misc 182 ensure => directory,
105     owner => root,
106     group => root,
107     mode => 644,
108     }
109 misc 908
110     file { "/etc/httpd/conf.d/mod_wsgi.conf":
111     ensure => present,
112     owner => root,
113     group => root,
114     mode => 644,
115 misc 1065 require => Package['apache-conf'],
116 misc 1188 content => template('apache/mod_wsgi.conf'),
117 misc 1186 notify => Service['apache'],
118 misc 908 }
119    
120 misc 80 }
121 misc 778
122     class mod_proxy inherits base {
123     package { "apache-mod_proxy":
124     ensure => installed
125     }
126     }
127 misc 167
128 misc 929 class mod_public_html inherits base {
129     package { "apache-mod_public_html":
130     ensure => installed
131     }
132     }
133    
134 dams 1021 class mod_deflate inherits base {
135     package { "apache-mod_deflate":
136     ensure => installed
137     }
138     }
139    
140 misc 928 define vhost_base($content = '',
141     $location = '/dev/null',
142     $use_ssl = false,
143 misc 930 $vhost = false,
144 misc 932 $aliases = {},
145 misc 935 $server_aliases = [],
146 misc 930 $enable_public_html = false) {
147 misc 928 if ! $vhost {
148     $real_vhost = $name
149     } else {
150     $real_vhost = $vhost
151 misc 176 }
152 misc 167
153 misc 489 if $use_ssl {
154     include apache::mod_ssl
155 boklm 1248 if $wildcard_sslcert != 'true' {
156 boklm 1237 openssl::self_signed_cert{ "$real_vhost":
157     directory => "/etc/ssl/apache/",
158     before => File["$filename"],
159     }
160     }
161 misc 489 }
162    
163 misc 930 if $enable_public_html {
164     include apache::mod_public_html
165     }
166    
167 misc 928 $filename = "$name.conf"
168     file { "$filename":
169     path => "/etc/httpd/conf/vhosts.d/$filename",
170 misc 167 ensure => "present",
171     owner => root,
172     group => root,
173     mode => 644,
174     notify => Service['apache'],
175 misc 1065 require => Package['apache-conf'],
176 misc 928 content => template("apache/vhost_base.conf")
177     }
178     }
179    
180     define vhost_redirect_ssl() {
181     vhost_base { "redirect_ssl_$name":
182     vhost => $name,
183     content => template("apache/vhost_ssl_redirect.conf")
184     }
185     }
186    
187     define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false) {
188    
189     include apache::mod_fastcgi
190     vhost_base { $name:
191     use_ssl => $use_ssl,
192 misc 167 content => template("apache/vhost_catalyst_app.conf")
193     }
194     }
195 misc 182
196 misc 1193 define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) {
197 misc 182 include apache::mod_wsgi
198 misc 928 vhost_base { $name:
199 misc 934 use_ssl => $use_ssl,
200 misc 1193 content => template("apache/vhost_django_app.conf"),
201     aliases => $aliases,
202 misc 621 }
203 misc 928
204 misc 612 # module is a ruby reserved keyword, cannot be used in templates
205     $django_module = $module
206 misc 182 file { "$name.wsgi":
207 misc 201 path => "/usr/local/lib/wsgi/$name.wsgi",
208 misc 182 ensure => "present",
209     owner => root,
210     group => root,
211     mode => 755,
212     notify => Service['apache'],
213     content => template("apache/django.wsgi")
214     }
215     }
216 boklm 280
217 misc 935 define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) {
218 misc 812 include apache::mod_wsgi
219 misc 933 vhost_base { $name:
220     aliases => $aliases,
221 misc 935 server_aliases => $server_aliases,
222 misc 812 content => template("apache/vhost_wsgi.conf")
223     }
224     }
225    
226 boklm 280 define vhost_other_app($vhost_file) {
227 misc 412 include apache::base
228 boklm 280 file { "$name.conf":
229     path => "/etc/httpd/conf/vhosts.d/$name.conf",
230     ensure => "present",
231     owner => root,
232     group => root,
233     mode => 644,
234     notify => Service['apache'],
235 misc 1065 require => Package['apache-conf'],
236 boklm 280 content => template($vhost_file)
237     }
238     }
239    
240 misc 742 define vhost_simple($location) {
241     include apache::base
242 misc 928 vhost_base { $name:
243     location => $location,
244     }
245 misc 742 }
246    
247 boklm 1319 define vhost_redirect($url,
248     $vhost = false,
249     $use_ssl = false) {
250 misc 931 include apache::base
251     vhost_base { $name:
252 boklm 1319 use_ssl => $use_ssl,
253     vhost => $vhost,
254 misc 931 content => template("apache/vhost_redirect.conf"),
255     }
256     }
257    
258 misc 1103 define vhost_reverse_proxy($url,
259     $vhost = false,
260     $use_ssl = false) {
261 misc 778 include apache::mod_proxy
262 misc 928 vhost_base { $name:
263 misc 1102 use_ssl => $use_ssl,
264 misc 1103 vhost => $vhost,
265 misc 778 content => template("apache/vhost_reverse_proxy.conf")
266 misc 928 }
267 misc 778 }
268    
269 boklm 280 define webapp_other($webapp_file) {
270 misc 422 include apache::base
271 boklm 280 $webappname = $name
272     file { "webapp_$name.conf":
273     path => "/etc/httpd/conf/webapps.d/$webappname.conf",
274     ensure => "present",
275     owner => root,
276     group => root,
277     mode => 644,
278     notify => Service['apache'],
279 misc 1065 require => Package['apache-conf'],
280 boklm 280 content => template($webapp_file)
281     }
282     }
283 misc 80 }

  ViewVC Help
Powered by ViewVC 1.1.30