/[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 890 - (hide annotations) (download)
Mon Jan 24 12:22:10 2011 UTC (13 years, 2 months ago) by misc
File size: 6256 byte(s)
allow to set aliases for wsgi powered web application ( should be refactored, IMHO )
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 96 service { httpd:
10     alias => apache,
11 misc 80 ensure => running,
12     subscribe => [ Package['apache-mpm-prefork'] ],
13     }
14 misc 117
15     file { "customization.conf":
16     ensure => present,
17 misc 126 path => "/etc/httpd/conf.d/customization.conf",
18 misc 117 content => template("apache/customization.conf"),
19     require => Package["apache"],
20     notify => Service["apache"],
21     owner => root,
22     group => root,
23     mode => 644,
24     }
25 boklm 207
26     file { "00_default_vhosts.conf":
27     path => "/etc/httpd/conf/vhosts.d/00_default_vhosts.conf",
28     ensure => "present",
29     owner => root,
30     group => root,
31     mode => 644,
32     notify => Service['apache'],
33     content => template("apache/00_default_vhosts.conf")
34     }
35 misc 80 }
36    
37     class mod_php inherits base {
38     package { "apache-mod_php":
39     ensure => installed
40     }
41     }
42    
43     class mod_perl inherits base {
44     package { "apache-mod_perl":
45     ensure => installed
46     }
47     }
48    
49 misc 84 class mod_fcgid inherits base {
50     package { "apache-mod_fcgid":
51     ensure => installed
52     }
53     }
54    
55 misc 124 class mod_fastcgi inherits base {
56     package { "apache-mod_fastcgi":
57     ensure => installed
58     }
59     }
60 misc 84
61 misc 192 class mod_ssl inherits base {
62 misc 487 file { "/etc/ssl/apache/":
63     ensure => directory
64     }
65    
66 misc 192 package { "apache-mod_ssl":
67     ensure => installed
68     }
69     }
70    
71 misc 80 class mod_wsgi inherits base {
72     package { "apache-mod_wsgi":
73     ensure => installed
74     }
75 misc 182
76 misc 201 file { "/usr/local/lib/wsgi":
77 misc 182 ensure => directory,
78     owner => root,
79     group => root,
80     mode => 644,
81     }
82 misc 80 }
83 misc 778
84     class mod_proxy inherits base {
85     package { "apache-mod_proxy":
86     ensure => installed
87     }
88     }
89 misc 167
90 misc 176 define vhost_redirect_ssl() {
91     file { "redirect_ssl_$name.conf":
92 misc 201 path => "/etc/httpd/conf/vhosts.d/redirect_ssl_$name.conf",
93 misc 176 ensure => "present",
94     owner => root,
95     group => root,
96     mode => 644,
97     notify => Service['apache'],
98     content => template("apache/vhost_ssl_redirect.conf")
99     }
100     }
101 misc 167
102 misc 194 define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false) {
103 misc 176
104 misc 167 include apache::mod_fastcgi
105    
106 misc 489 if $use_ssl {
107     include apache::mod_ssl
108     openssl::self_signed_cert{ "$name":
109 misc 497 directory => "/etc/ssl/apache/",
110     before => File["$name.conf"],
111 misc 489 }
112     }
113    
114 misc 167 file { "$name.conf":
115 misc 201 path => "/etc/httpd/conf/vhosts.d/$name.conf",
116 misc 167 ensure => "present",
117     owner => root,
118     group => root,
119     mode => 644,
120     notify => Service['apache'],
121     content => template("apache/vhost_catalyst_app.conf")
122     }
123     }
124 misc 182
125 misc 621 define vhost_django_app($module = false, $module_path = false, $use_ssl = false) {
126 misc 182 include apache::mod_wsgi
127    
128 misc 621 if $use_ssl {
129     include apache::mod_ssl
130     openssl::self_signed_cert{ "$name":
131     directory => "/etc/ssl/apache/",
132     before => File["$name.conf"],
133     }
134     }
135    
136 misc 612 # module is a ruby reserved keyword, cannot be used in templates
137     $django_module = $module
138 misc 182 file { "$name.conf":
139 misc 201 path => "/etc/httpd/conf/vhosts.d/$name.conf",
140 misc 182 ensure => "present",
141     owner => root,
142     group => root,
143     mode => 644,
144     notify => Service['apache'],
145     content => template("apache/vhost_django_app.conf")
146     }
147    
148     # fichier django wsgi
149     file { "$name.wsgi":
150 misc 201 path => "/usr/local/lib/wsgi/$name.wsgi",
151 misc 182 ensure => "present",
152     owner => root,
153     group => root,
154     mode => 755,
155     notify => Service['apache'],
156     content => template("apache/django.wsgi")
157     }
158     }
159 boklm 280
160 misc 890 define vhost_wsgi($wsgi_path, $aliases = false) {
161 misc 812 include apache::mod_wsgi
162     file { "$name.conf":
163     path => "/etc/httpd/conf/vhosts.d/$name.conf",
164     ensure => "present",
165     owner => root,
166     group => root,
167     mode => 644,
168     notify => Service['apache'],
169     content => template("apache/vhost_wsgi.conf")
170     }
171     }
172    
173 boklm 280 define vhost_other_app($vhost_file) {
174 misc 412 include apache::base
175 boklm 280 file { "$name.conf":
176     path => "/etc/httpd/conf/vhosts.d/$name.conf",
177     ensure => "present",
178     owner => root,
179     group => root,
180     mode => 644,
181     notify => Service['apache'],
182     content => template($vhost_file)
183     }
184     }
185    
186 misc 742 define vhost_simple($location) {
187     include apache::base
188     file { "$name.conf":
189     path => "/etc/httpd/conf/vhosts.d/$name.conf",
190     ensure => "present",
191     owner => root,
192     group => root,
193     mode => 644,
194     notify => Service['apache'],
195     content => template("apache/vhost_simple.conf")
196     }
197     }
198    
199 misc 778 define vhost_reverse_proxy($url) {
200     include apache::mod_proxy
201     file { "$name.conf":
202     path => "/etc/httpd/conf/vhosts.d/$name.conf",
203     ensure => "present",
204     owner => root,
205     group => root,
206     mode => 644,
207     notify => Service['apache'],
208     content => template("apache/vhost_reverse_proxy.conf")
209     }
210     }
211    
212 boklm 280 define webapp_other($webapp_file) {
213 misc 422 include apache::base
214 boklm 280 $webappname = $name
215     file { "webapp_$name.conf":
216     path => "/etc/httpd/conf/webapps.d/$webappname.conf",
217     ensure => "present",
218     owner => root,
219     group => root,
220     mode => 644,
221     notify => Service['apache'],
222     content => template($webapp_file)
223     }
224     }
225 misc 80 }

  ViewVC Help
Powered by ViewVC 1.1.30