/[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 182 - (hide annotations) (download)
Sat Nov 6 17:50:14 2010 UTC (13 years, 5 months ago) by misc
File size: 3047 byte(s)
- add django support with wsgi
1 misc 80 class apache {
2    
3 misc 181 $vhost_dir = "/etc/httpd/conf/vhosts.d"
4 misc 182 $wsgi_dir = "/usr/local/lib/wsgi"
5 misc 181
6 misc 80 class base {
7     package { "apache-mpm-prefork":
8 misc 117 alias => apache,
9 misc 80 ensure => installed
10     }
11    
12 misc 96 service { httpd:
13     alias => apache,
14 misc 80 ensure => running,
15     subscribe => [ Package['apache-mpm-prefork'] ],
16     }
17 misc 117
18     file { "customization.conf":
19     ensure => present,
20 misc 126 path => "/etc/httpd/conf.d/customization.conf",
21 misc 117 content => template("apache/customization.conf"),
22     require => Package["apache"],
23     notify => Service["apache"],
24     owner => root,
25     group => root,
26     mode => 644,
27     }
28 misc 80 }
29    
30     class mod_php inherits base {
31     package { "apache-mod_php":
32     ensure => installed
33     }
34     }
35    
36     class mod_perl inherits base {
37     package { "apache-mod_perl":
38     ensure => installed
39     }
40     }
41    
42 misc 84 class mod_fcgid inherits base {
43     package { "apache-mod_fcgid":
44     ensure => installed
45     }
46     }
47    
48 misc 124 class mod_fastcgi inherits base {
49     package { "apache-mod_fastcgi":
50     ensure => installed
51     }
52     }
53 misc 84
54 misc 80 class mod_wsgi inherits base {
55     package { "apache-mod_wsgi":
56     ensure => installed
57     }
58 misc 182
59     file { $wsgi_dir:
60     ensure => directory,
61     owner => root,
62     group => root,
63     mode => 644,
64     }
65 misc 80 }
66 misc 167
67 misc 176 define vhost_redirect_ssl() {
68     file { "redirect_ssl_$name.conf":
69 misc 181 path => "$vhost_dir/redirect_ssl_$name.conf",
70 misc 176 ensure => "present",
71     owner => root,
72     group => root,
73     mode => 644,
74     notify => Service['apache'],
75     content => template("apache/vhost_ssl_redirect.conf")
76     }
77     }
78 misc 167
79 misc 176 define vhost_catalyst_app($script, $process = 4, $use_ssl = false) {
80    
81 misc 167 include apache::mod_fastcgi
82    
83     file { "$name.conf":
84 misc 181 path => "$vhost_dir/$name.conf",
85 misc 167 ensure => "present",
86     owner => root,
87     group => root,
88     mode => 644,
89     notify => Service['apache'],
90     content => template("apache/vhost_catalyst_app.conf")
91     }
92     }
93 misc 182
94     define vhost_django_app($module, $module_path = '/usr/share') {
95     include apache::mod_wsgi
96    
97     file { "$name.conf":
98     path => "$vhost_dir/$name.conf",
99     ensure => "present",
100     owner => root,
101     group => root,
102     mode => 644,
103     notify => Service['apache'],
104     content => template("apache/vhost_django_app.conf")
105     }
106    
107     # fichier django wsgi
108     file { "$name.wsgi":
109     path => "$wsgi_dir/$name.wsgi",
110     ensure => "present",
111     owner => root,
112     group => root,
113     mode => 755,
114     notify => Service['apache'],
115     content => template("apache/django.wsgi")
116     }
117     }
118 misc 80 }

  ViewVC Help
Powered by ViewVC 1.1.30