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

  ViewVC Help
Powered by ViewVC 1.1.30