aboutsummaryrefslogtreecommitdiffstats
path: root/modules/apache/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/apache/manifests/init.pp')
-rw-r--r--modules/apache/manifests/init.pp33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/apache/manifests/init.pp b/modules/apache/manifests/init.pp
index 6b8f7bef..83f89088 100644
--- a/modules/apache/manifests/init.pp
+++ b/modules/apache/manifests/init.pp
@@ -1,6 +1,7 @@
class apache {
$vhost_dir = "/etc/httpd/conf/vhosts.d"
+ $wsgi_dir = "/usr/local/lib/wsgi"
class base {
package { "apache-mpm-prefork":
@@ -54,6 +55,13 @@ class apache {
package { "apache-mod_wsgi":
ensure => installed
}
+
+ file { $wsgi_dir:
+ ensure => directory,
+ owner => root,
+ group => root,
+ mode => 644,
+ }
}
define vhost_redirect_ssl() {
@@ -82,4 +90,29 @@ class apache {
content => template("apache/vhost_catalyst_app.conf")
}
}
+
+ define vhost_django_app($module, $module_path = '/usr/share') {
+ include apache::mod_wsgi
+
+ file { "$name.conf":
+ path => "$vhost_dir/$name.conf",
+ ensure => "present",
+ owner => root,
+ group => root,
+ mode => 644,
+ notify => Service['apache'],
+ content => template("apache/vhost_django_app.conf")
+ }
+
+ # fichier django wsgi
+ file { "$name.wsgi":
+ path => "$wsgi_dir/$name.wsgi",
+ ensure => "present",
+ owner => root,
+ group => root,
+ mode => 755,
+ notify => Service['apache'],
+ content => template("apache/django.wsgi")
+ }
+ }
}