/[adm]/puppet/modules/apache/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/apache/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1464 - (show 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 class apache {
2
3 class base {
4 package { "apache-mpm-prefork":
5 alias => apache,
6 ensure => installed
7 }
8
9 package { "apache-conf":
10 ensure => installed,
11 }
12
13 service { httpd:
14 alias => apache,
15 ensure => running,
16 subscribe => [ Package['apache-mpm-prefork'] ],
17 }
18
19 file { "customization.conf":
20 ensure => present,
21 path => "/etc/httpd/conf.d/customization.conf",
22 content => template("apache/customization.conf"),
23 require => Package["apache-conf"],
24 notify => Service["apache"],
25 owner => root,
26 group => root,
27 mode => 644,
28 }
29
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 require => Package["apache-conf"],
38 content => template("apache/00_default_vhosts.conf")
39 }
40
41 }
42
43 class mod_php inherits base {
44 package { "apache-mod_php":
45 ensure => installed
46 }
47
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 content => template('apache/mod_php.conf'),
55 notify => Service['apache'],
56 }
57 }
58
59 class mod_perl inherits base {
60 package { "apache-mod_perl":
61 ensure => installed
62 }
63 }
64
65 class mod_fcgid inherits base {
66 package { "apache-mod_fcgid":
67 ensure => installed
68 }
69 }
70
71 class mod_fastcgi inherits base {
72 package { "apache-mod_fastcgi":
73 ensure => installed
74 }
75 }
76
77 class mod_ssl inherits base {
78 file { "/etc/ssl/apache/":
79 ensure => directory
80 }
81
82 package { "apache-mod_ssl":
83 ensure => installed
84 }
85
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 }
97
98 class mod_wsgi inherits base {
99 package { "apache-mod_wsgi":
100 ensure => installed
101 }
102
103 file { "/usr/local/lib/wsgi":
104 ensure => directory,
105 owner => root,
106 group => root,
107 mode => 644,
108 }
109
110 file { "/etc/httpd/conf.d/mod_wsgi.conf":
111 ensure => present,
112 owner => root,
113 group => root,
114 mode => 644,
115 require => Package['apache-conf'],
116 content => template('apache/mod_wsgi.conf'),
117 notify => Service['apache'],
118 }
119
120 }
121
122 class mod_proxy inherits base {
123 package { "apache-mod_proxy":
124 ensure => installed
125 }
126 }
127
128 class mod_public_html inherits base {
129 package { "apache-mod_public_html":
130 ensure => installed
131 }
132 }
133
134 class mod_deflate inherits base {
135 package { "apache-mod_deflate":
136 ensure => installed
137 }
138 }
139
140 define vhost_base($content = '',
141 $location = '/dev/null',
142 $use_ssl = false,
143 $vhost = false,
144 $aliases = {},
145 $server_aliases = [],
146 $enable_public_html = false) {
147 include apache::base
148 if ! $vhost {
149 $real_vhost = $name
150 } else {
151 $real_vhost = $vhost
152 }
153
154 if $use_ssl {
155 include apache::mod_ssl
156 if $wildcard_sslcert != 'true' {
157 openssl::self_signed_cert{ "$real_vhost":
158 directory => "/etc/ssl/apache/",
159 before => File["$filename"],
160 }
161 }
162 }
163
164 if $enable_public_html {
165 include apache::mod_public_html
166 }
167
168 $filename = "$name.conf"
169 file { "$filename":
170 path => "/etc/httpd/conf/vhosts.d/$filename",
171 ensure => "present",
172 owner => root,
173 group => root,
174 mode => 644,
175 notify => Service['apache'],
176 require => Package['apache-conf'],
177 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 content => template("apache/vhost_catalyst_app.conf")
194 }
195 }
196
197 define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) {
198 include apache::mod_wsgi
199 vhost_base { $name:
200 use_ssl => $use_ssl,
201 content => template("apache/vhost_django_app.conf"),
202 aliases => $aliases,
203 }
204
205 # module is a ruby reserved keyword, cannot be used in templates
206 $django_module = $module
207 file { "$name.wsgi":
208 path => "/usr/local/lib/wsgi/$name.wsgi",
209 ensure => "present",
210 owner => root,
211 group => root,
212 mode => 755,
213 notify => Service['apache'],
214 content => template("apache/django.wsgi")
215 }
216 }
217
218 define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) {
219 include apache::mod_wsgi
220 vhost_base { $name:
221 aliases => $aliases,
222 server_aliases => $server_aliases,
223 content => template("apache/vhost_wsgi.conf")
224 }
225 }
226
227 define vhost_other_app($vhost_file) {
228 include apache::base
229 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 require => Package['apache-conf'],
237 content => template($vhost_file)
238 }
239 }
240
241 define vhost_simple($location) {
242 include apache::base
243 vhost_base { $name:
244 location => $location,
245 }
246 }
247
248 define vhost_redirect($url,
249 $vhost = false,
250 $use_ssl = false) {
251 include apache::base
252 vhost_base { $name:
253 use_ssl => $use_ssl,
254 vhost => $vhost,
255 content => template("apache/vhost_redirect.conf"),
256 }
257 }
258
259 define vhost_reverse_proxy($url,
260 $vhost = false,
261 $use_ssl = false) {
262 include apache::mod_proxy
263 vhost_base { $name:
264 use_ssl => $use_ssl,
265 vhost => $vhost,
266 content => template("apache/vhost_reverse_proxy.conf")
267 }
268 }
269
270 define webapp_other($webapp_file) {
271 include apache::base
272 $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 require => Package['apache-conf'],
281 content => template($webapp_file)
282 }
283 }
284 }

  ViewVC Help
Powered by ViewVC 1.1.30