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

  ViewVC Help
Powered by ViewVC 1.1.30