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

  ViewVC Help
Powered by ViewVC 1.1.30