/[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 1464 - (hide annotations) (download)
Mon Apr 4 14:06:03 2011 UTC (13 years ago) by boklm
File size: 7778 byte(s)
include apache::base in vhost_base
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 boklm 1464 include apache::base
148 misc 928 if ! $vhost {
149     $real_vhost = $name
150     } else {
151     $real_vhost = $vhost
152 misc 176 }
153 misc 167
154 misc 489 if $use_ssl {
155     include apache::mod_ssl
156 boklm 1248 if $wildcard_sslcert != 'true' {
157 boklm 1237 openssl::self_signed_cert{ "$real_vhost":
158     directory => "/etc/ssl/apache/",
159     before => File["$filename"],
160     }
161     }
162 misc 489 }
163    
164 misc 930 if $enable_public_html {
165     include apache::mod_public_html
166     }
167    
168 misc 928 $filename = "$name.conf"
169     file { "$filename":
170     path => "/etc/httpd/conf/vhosts.d/$filename",
171 misc 167 ensure => "present",
172     owner => root,
173     group => root,
174     mode => 644,
175     notify => Service['apache'],
176 misc 1065 require => Package['apache-conf'],
177 misc 928 content => template("apache/vhost_base.conf")
178     }
179     }
180    
181     define vhost_redirect_ssl() {
182     vhost_base { "redirect_ssl_$name":
183     vhost => $name,
184     content => template("apache/vhost_ssl_redirect.conf")
185     }
186     }
187    
188     define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false) {
189    
190     include apache::mod_fastcgi
191     vhost_base { $name:
192     use_ssl => $use_ssl,
193 misc 167 content => template("apache/vhost_catalyst_app.conf")
194     }
195     }
196 misc 182
197 misc 1193 define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) {
198 misc 182 include apache::mod_wsgi
199 misc 928 vhost_base { $name:
200 misc 934 use_ssl => $use_ssl,
201 misc 1193 content => template("apache/vhost_django_app.conf"),
202     aliases => $aliases,
203 misc 621 }
204 misc 928
205 misc 612 # module is a ruby reserved keyword, cannot be used in templates
206     $django_module = $module
207 misc 182 file { "$name.wsgi":
208 misc 201 path => "/usr/local/lib/wsgi/$name.wsgi",
209 misc 182 ensure => "present",
210     owner => root,
211     group => root,
212     mode => 755,
213     notify => Service['apache'],
214     content => template("apache/django.wsgi")
215     }
216     }
217 boklm 280
218 misc 935 define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) {
219 misc 812 include apache::mod_wsgi
220 misc 933 vhost_base { $name:
221     aliases => $aliases,
222 misc 935 server_aliases => $server_aliases,
223 misc 812 content => template("apache/vhost_wsgi.conf")
224     }
225     }
226    
227 boklm 280 define vhost_other_app($vhost_file) {
228 misc 412 include apache::base
229 boklm 280 file { "$name.conf":
230     path => "/etc/httpd/conf/vhosts.d/$name.conf",
231     ensure => "present",
232     owner => root,
233     group => root,
234     mode => 644,
235     notify => Service['apache'],
236 misc 1065 require => Package['apache-conf'],
237 boklm 280 content => template($vhost_file)
238     }
239     }
240    
241 misc 742 define vhost_simple($location) {
242     include apache::base
243 misc 928 vhost_base { $name:
244     location => $location,
245     }
246 misc 742 }
247    
248 boklm 1319 define vhost_redirect($url,
249     $vhost = false,
250     $use_ssl = false) {
251 misc 931 include apache::base
252     vhost_base { $name:
253 boklm 1319 use_ssl => $use_ssl,
254     vhost => $vhost,
255 misc 931 content => template("apache/vhost_redirect.conf"),
256     }
257     }
258    
259 misc 1103 define vhost_reverse_proxy($url,
260     $vhost = false,
261     $use_ssl = false) {
262 misc 778 include apache::mod_proxy
263 misc 928 vhost_base { $name:
264 misc 1102 use_ssl => $use_ssl,
265 misc 1103 vhost => $vhost,
266 misc 778 content => template("apache/vhost_reverse_proxy.conf")
267 misc 928 }
268 misc 778 }
269    
270 boklm 280 define webapp_other($webapp_file) {
271 misc 422 include apache::base
272 boklm 280 $webappname = $name
273     file { "webapp_$name.conf":
274     path => "/etc/httpd/conf/webapps.d/$webappname.conf",
275     ensure => "present",
276     owner => root,
277     group => root,
278     mode => 644,
279     notify => Service['apache'],
280 misc 1065 require => Package['apache-conf'],
281 boklm 280 content => template($webapp_file)
282     }
283     }
284 misc 80 }

  ViewVC Help
Powered by ViewVC 1.1.30